-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
ALL
-
Repl 2024-02-05
-
135
When initial sync starts, we will reset lastDurable, lastApplied and lastWritten to null optime. Before SERVER-47898, if the journal flusher tries updating lastDurable, it will end up in a noop because lastDurable cannot advance beyond lastApplied.
After SERVER-47898, lastDurable can be advanced beyond lastApplied, which in a race condition that the journal flusher takes a token before initial sync resets optime and uses that token to update lastDurable after initial sync resets optime, will trigger the invariant in SERVER-83573 that the new lastDurable cannot be greater than the current lastWritten.
We can make the relaxed lastDurable update from SERVER-47898 a bit more strict that if the current lastWritten is null optime, we ignore the lastDurable call and don't check the invariant.