Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-31806

makeNoopWriter crashes when the last applied optime advances in the face of failed appendOplogNotes.

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.0-rc4, 3.7.1
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • Sharding 2017-11-13, Sharding 2017-12-04
    • 0

      I believe this is 3.6 required.

      makeNoopWriteIfNeeded (in read_concern.cpp) will ensure an oplog document exists on the primary with at least the clusterTime. This guarantees the secondary will eventually apply up to the requested clusterTime.

      This method can succeed in two(ish) cases.

      1. The method successfully sends a appendOplogNote to the primary with the requested cluster time. The caller can wait for this document to come down the pipe with confidence.
      2. While making requests that are not succeeding, the lastAppliedOpTime continues to advance. If it advances beyond the requested clusterTime, there's no need to make further requests.
      3. A generalization of the previous point, a request may never need to be made, and the method will immediately return.

      The method initializes a return status of OK. Some error cases will immediately return an error code, such as not finding the correct shard, or the number of retries to make the request has been exceeded. Otherwise status is assigned the latest result of the request.

      However, when a request fails, leaving status in an error state, the lastAppliedOpTime is refreshed. If this new value exceeds the requested clusterTime, the loop will exit, but the code invariants that the status is ok.

            Assignee:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Reporter:
            daniel.gottlieb@mongodb.com Daniel Gottlieb (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: