[SERVER-34674] Prevent logical clock from advancing while it's disabled Created: 25/Apr/18  Updated: 29/Oct/23  Resolved: 14/May/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.7.7
Fix Version/s: 4.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Blake Oler Assignee: Jack Mulrow
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2018-05-21
Participants:
Linked BF Score: 56

 Description   

A race condition exists in the following situation:

  1. A call to readRequestMetadata can pass the check for the logical clock's being enabled.
  2. A node can transition to an arbiter on another thread, disabling the logical clock.
  3. readRequestMetadata can attempt to advance the logical clock, tripping the invariant that the logical clock is enabled.

Relevant lines are here:

  1. https://github.com/mongodb/mongo/blob/b7b55e75bbf18bcd7e38fdee430e0fd972183f68/src/mongo/rpc/metadata.cpp#L93
  2. https://github.com/mongodb/mongo/blob/b7b55e75bbf18bcd7e38fdee430e0fd972183f68/src/mongo/db/repl/replication_coordinator_impl.cpp#L569
  3. https://github.com/mongodb/mongo/blob/b7b55e75bbf18bcd7e38fdee430e0fd972183f68/src/mongo/rpc/metadata.cpp#L112


 Comments   
Comment by Githook User [ 14/May/18 ]

Author:

{'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}

Message: SERVER-34674 Remove _isEnabled invariants from the logical clock
Branch: master
https://github.com/mongodb/mongo/commit/15d7cab640425bcb4de62e6b3c13d9188181f5ce

Generated at Thu Feb 08 04:37:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.