-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Replication
-
Fully Compatible
-
ALL
-
Repl 2026-07-06
-
200
-
None
-
None
-
None
-
None
-
None
-
None
-
None
BF-42873 found that the following order of events is possible:
- The validate test hook performs an insert and drop, gets the opTime of the write to use for atClusterTime
- The writes make it to the secondaries but are not applied yet on at least one node
- w=N write concern is satisfied so we return from the commands which allows us to run validate with atClusterTime=T (This is because majority write concern acknowledgement behavior was changed in 8.0. We acknowledge the w=N insert not when the oplog entry is applied, but when we journal it to the oplog.)
- Validate opens the read snapshot at time T, even though we have not yet applied all oplog up until that time
- We finally go to apply the oplog entries and hit this invariant, since we are committing behind an open read timestamp.
In the real read concern code, we call replCoord->waitUntilOpTimeForRead before setting the read timestamp to an atClusterTime timestamp. This call is not included here in the[ validate code|https://github.com/10gen/mongo/blob/92f469a3cd05ee5b9e3eba295f74966d23bdc8f2/src/mongo/db/validate/validate_state.cpp#L316-L317]. Adding this wait call should solve this issue.