Prevent logical clock from advancing while it's disabled

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.0.0-rc0
    • Affects Version/s: 3.7.7
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • Sharding 2018-05-21
    • 56
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

            Assignee:
            Jack Mulrow
            Reporter:
            Blake Oler
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: