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

Initial sync criteria needs to check minValid, not the oplog

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.3.2
    • Affects Version/s: 2.2.2
    • Component/s: Replication
    • None
    • ALL

      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.

            Assignee:
            kristina Kristina Chodorow (Inactive)
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: