-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication
-
Replication
-
Fully Compatible
-
v8.0
-
Repl 2024-04-01, Repl 2024-04-15, Repl 2024-04-29, Repl 2024-05-13, Repl 2024-05-27, Repl 2024-06-10, Repl 2024-06-24, Repl 2024-07-08, Repl 2024-07-22, Repl 2024-08-05, Repl 2024-08-19
After an election, the majority commit point on the new primary may be stale. This can cause a client that performs majority writes and majority reads with readPreference:"primary" to fail to read its own write after an election.
Customers can work around this issue by using causally consistent sessions, but if the end user may interact with the database through multiple app servers, this requires passing the clusterTime token all the way back to the user's browser/app, which is impractical. It would be preferable if users can get read-your-writes by performing majority writes and majority reads with readPreference:"primary".
One way to solve this is by blocking majority reads on the new primary until it commits its first write in the new term. This might require shortening the time taken to commit the first write in the new term.
Note that even after this issue is addressed, clients that perform majority writes and majority reads with readPreference:"primary" may still fail to read their own writes after an unplanned election, if they are interacting with the database through multiple app servers or mongoses. However, this ticket describes the only known issue caused by planned maintenance, which accounts for the vast majority of elections.
- is related to
-
SERVER-78813 Commit point propagation fails indefinitely with exhaust cursors with null lastCommitted optime
- Closed
-
SERVER-89619 Avoid serving stale data with primary read preference + majority read concern on old primary during an unplanned election
- Blocked
- related to
-
SERVER-63815 Add section on probable-read-you-writes behavior to arch guide
- Backlog
-
SERVER-68514 Delay announcement of new primary until first oplog entry in term is majority committed
- Backlog