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

Initial sync criteria needs to check minValid, not the oplog

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.3.2
    • Component/s: Replication
    • Labels:
      None
    • Operating System:
      ALL

      Description

      The criteria for initiating an initial sync currently checks to see if no ops are in the oplog. This worked fine until we started adding ops as part of initial sync in order to fix index unique constraint violations.
      If you were to crash after cloning dbs but before generating indexes, it would be possible to restart the node and have it go straight into SECONDARY without completing the index builds.

      Instead, the criteria should be whether the node has a minValid set. minValid is not set until the very end of initial sync after everything has successfully completed.
      As a sanity check, the node should fassert if it finds that minValid exists but there are no ops in the oplog, as this situation should be impossible.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kristina Kristina Chodorow
              Reporter:
              milkie Eric Milkie
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: