📝Hybrid Logical Clock
- source
HLC combines physical clock with logical clock.
When comparing two clocks, physical time takes priority and logical clocks are only compared when physical timestamps are equal.
When clocks are combined, we always take maximal physical time between all HLCs and current node’s physical time, and increment logical clock from the HLC with highest physical time. If current physical time wins, we reset logical clock.
Note that hybrid logical clock does not guarantee uniqueness—multiple nodes may generate the same HLC. To totally order messages, some unique disambiguator (e.g., node id) is needed.