3 ms·
Time means logical clock. We incorporate a number of mechanisms to track causality, such that for each changeset we know exactly which other changesets it was b
by bigfish24 10y ago
Time means logical clock. We incorporate a number of mechanisms to track causality, such that for each changeset we know exactly which other changesets it was based on. Timestamps are only used when two changesets that are causally unrelated conflict, in which case we use the timestamp to decide on the ordering.
- gjjrfcbugxbhf 10y agoHow do you know whether timestamps are synchronized if network is partitioned?
- simonask 10y agoWe don't, and we don't need to. Timestamps are only used to merge conflicting but causally unrelated changes. In principle we could pick a random number instead of using the timestamp and we would still achieve convergence, but it just so happens that the current local time on the device is highly correlated with the user's experience of real time, so that if the user makes conflicting changes on two offline devices, those changes will still be properly ordered in the general case.
- gjjrfcbugxbhf 10y agoOK good luck with that. I guess you keep a graph of all the changes so that the accidental overwrites that will happen+ can be stepped back? + for example a surprising number of computers have their local time changed to avoid license terms of poorly enforced proprietary software.