Details
Description
A race condition exists in the following situation:
- A call to readRequestMetadata can pass the check for the logical clock's being enabled.
- A node can transition to an arbiter on another thread, disabling the logical clock.
- readRequestMetadata can attempt to advance the logical clock, tripping the invariant that the logical clock is enabled.
Relevant lines are here:
- https://github.com/mongodb/mongo/blob/b7b55e75bbf18bcd7e38fdee430e0fd972183f68/src/mongo/rpc/metadata.cpp#L93
- https://github.com/mongodb/mongo/blob/b7b55e75bbf18bcd7e38fdee430e0fd972183f68/src/mongo/db/repl/replication_coordinator_impl.cpp#L569
- https://github.com/mongodb/mongo/blob/b7b55e75bbf18bcd7e38fdee430e0fd972183f68/src/mongo/rpc/metadata.cpp#L112