Time is an illusion – challenges in distributed computing synchronization
queue.acm.org
queue.acm.org
If you want to be one of the few:
http://research.microsoft.com/en-us/um/people/lamport/pubs/t...
http://research.microsoft.com/en-us/um/people/lamport/pubs/p...
You would still be left with race conditions between the communicating nodes, but that is something you can't get around anyway.
As long as clocks at different places are synced with high precision, you could still sync operations within the epsilon bounds, despite a huge delay. Of course, that requires the system to be design accordingly to accommodate the huge latency.
If you want to know what time the server has right now, you can get it from the Response headers on your last communication (i.e., often the one you're decoding right now). If the server says this reply expires at noon but you think it's 1:15 already, you can sort out that the server really means "five minutes from now" and is 1:20 behind of you for some reason.
I'm starting to think at a properly constructed time library should contain local and remote time instead of trying to find an objective truth. It's too easy to transpose.
[edit: even I invert my clock skews from time to time.]
We disagree. Perfect clock obviates the need for protocol based consensus mechanism. Paxos & friends have substantial latency costs. Secondary effects of protocol based approach include NAK storms, reduction of available bandwidth (consumed by the chatty consensus protocol packets). Tertiary effects include triggering of congestion control mechanisms.
There is zero question that a distributed system built on high fidelity clocks will mop the proverbial floor in terms of performance.
Even with the hardware, google can't shrink the window past 7ms or so, based on published reports.
To preserve consistency there are situations where you need to wait out the clock uncertainty.
Spanner still uses paxos for replication because ordering is only part of the problem consensus solves.
If you really want strict ordering you can always impose arbitrary ordering. Ex: all events in tick X occur in the order each machine decides, and then order by machine IP address.
Now I'm thinking we should have modeled cause and effect and only used the dates when communicating with the customer (I bought what, when??).
But I'm not entirely sure what that looks like.
This doesn't match my experience at all. I've had smartphones disconnected from the network for weeks at a time without drifting "several minutes away" from the consensus time. Drift is a thing, but it seems like that estimate is several orders of magnitude larger than anything I've seen in practice.
I think it may just be badly phrased. "will drift out of sync within minutes" was meant as it'll almost assuredly have gained/lost a few microseconds from what it should have, given the progression of 'real' time for its frame of reference, but that it -may- be that bad. Which, yeah, sure, it -may-. Not bloody likely, but maybe.
You can get temperature compensated oscillators down to about 1ppm accuracy over a larger temperature range. 1ppm is about 1 second/week.
Back in the day I wrote a little utility where every time you adjusted your computer clock it took notice of the drift and fed that back into the time calculation. I.e. it continuously adjusted the clock based on the corrections given to it.
The point that the author makes about needing higher and higher precision though got me thinking about ways one might achieve that. I'm wondering if you could actually provide a master clock, a 1Ghz carrier, over network cables that originate from the master clock. If the master clock is synchronized with the bit stream, and you're seeing the bit stream locally, you first calibrate your clock with the master and then drive it from the bit stream and you should be in sync with respect to cable and time of flight delays.
[1] http://web.cs.wpi.edu/~cs4513/d07/Papers/Birrell,%20Levin,%2...
As for out of order and lost packets the TCP layer prevent out of order, but retransmissions on lost packets resulted in big jitter spikes. Those were rare enough to pull out as a special case. And there was layered on top an optimistic transaction protocol where you could ask for the current transaction id, increment it by one and send your transaction with the assumption that if someone landed before you it would fail and you would have to restart. That worked well for read mostly applications (like a name service).
The NoSQL database that Blekko designed uses a more complex promise system to preserve transaction ordering and it uses idempotent combinators which help manage time syncronization issues. But again, if we could wave a magic wand and get perfect synchronization it would be pretty interesting.
If I remember correctly RDTSC suffers from other issues like being affect by CPU throttling and also might be different if your process is re-scheduled on another core.
From the perspective of a photon it lives and dies in an instant. Even if it crosses the entire universe!
(Showing clearly why simultaneity does not exist in an absolute sense.)
Some will strive for absolute standards, while others maximize the net benefits of relativity.
My understanding of the root causes of the time problem is a poor education.
Basic definition of time : time is the accident of the accident, and the same causes giving the same effects, some of them being irreversible they define an ordered direction of events. Time is like temperature, it is measured relatively to the pulsation of an harmonic oscillator. A closed absolute system time does not exists. Since Einstein we also have to decorrelate the physical speed to the speed due to the geometrical expansion. (Cerenkov effect, yes you can go faster than the speed of light playing on this). Since quantum mechanics we know time is quantic and its uncertain capped by hbar/2 < dEdt
Hence a lot of problem when due to poor rigor and understanding (which amplify the aforementioned effect) time becomes that its nightmarish physical beast. And you are stuck with idiots, that even thinks that the colour of the skin influence your quality as a coder.
So here is my understanding of coder's problem with time. The mindset of coders I have met and boss alike is stuck in the 1800's. Where statistical physic, the dual nature of light, quantum mechanics, Einstein's relativity are known as trivial pursuit boring questions but no one cares of the implications.
Then they sux at understanding geometry vs physics but most of all they are stuck in the wrong physical world.
They live in a world of determinism where they would prefer compute the position and speed of every molecule in a gas than use the 'unpure' perfect law.
For time they are puzzled: - time is a length of vector; (how much time since)
- time is a point - deducted from an implicit 0 origin when taking a length;
- time is 1D vector so it behaves like a scalar, so it must be a scalar; (computing resulting size by adding/substracting as length/vector))
- there is a lot of politic involved in "time measure" (GMT, TZ, calendars, interstitial seconds) and politic is buggy thus it results in bugs;
- heisenberg DOES exists; they never care to measure the error and think it is wasted time;
- my time as a coder is always free;
- time cannot be uncertain since we have these high resolution clocks (the exactitude of time is such we never encounter uncertainty (and our code is executed in 0s)));
- GPS is a measuring instrument that magically corrects this, because it is perfect and has no errors because it is USA spatial "godly" "star streky" in the sky;
- acausality cannot locally happen because of asymmetries in topologies (slow/fast router vs short long path);
In short, most of coders are insanely crippled by their own culture of ignorance and their self importance.
Common scientifical knowledge that is more commonly understood by mc donalds employees has still not reached the brain of our elite architects/coders. And time - frequencies is one of the most important dimension of all applications.
The question I wonder is "how?". How is it even possible to have such a bias in the mass recruitment of coders that they select over confident thinkers that are lacking of curiosity so much they can blindfold themselves comfortably.
If the lack in scientific domain is that great, and reflects arrogant lacks in other domain ... then I think of creeping lack of culture in "business", "ethics", "legal", "cryptography", "probability", "algebrae" ...
I have provoked enough computer pro and made stats to know for sure their level of confidence should be dangerously inversely correlated to their level of actual knowledge.
I am very confident that IT has a corporate culture bias of valuating arrogant ignorant that "can do it" over careful thinkers that may say "it well never be doable"*
* yes, the Cretan paradox revisited
Unfortunately, if your intent was to communicate some idea to people who read your comment, then it didn't work because I honestly can't say what that idea might be.
I could make some witty remarks on certain things you've said or how you've said them, but that wouldn't be useful for either of us. So I won't.