https://github.com/mongodb/mongo/blob/master/src/mongo/db/logical_clock.cpp#L130-L135 :
this code has at least two bugs in it:
1) it should be ">="
2) ticks suppose to overflow into the seconds if they are > 2**31.
the fix is something like
invariant(ticks < 1U << 30)
if (clusterTimestamp.asTimestamp().getInc() + ticks >= 1U << 31) {
clusterTimestamp = {clusterTimestamp.asTimestamp().getTime() + 1, 1};
}
- is duplicated by
-
SERVER-17887 Overflow generated OpTimes from i field into t field
- Closed
- is related to
-
SERVER-18557 Change oplog OpTime format to raw 64bit values
- Backlog
- related to
-
SERVER-28420 For unit testing add LogicalClock that provides an API to control its wallclock
- Closed