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

Two-phase index build constraints should be checked at the completion of the index build

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.4
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Fully Compatible
    • ALL
    • Execution Team 2020-03-09
    • 14

      We call prepareInsertDeleteOptions once when initializing an index build, but as a resultthe GetKeysMode does not change dynamically as the replication state changes.

      Consider the following sequence where node1 is primary and node2 is secondary.

      1. Insert { A: invalid}
      2. start index build on node1 (kEnforceConstraints)
      3. start index build on node2 (kRelaxConstraints)
      4. stepUp node2 to primary, node1 is secondary. node2 continues relaxing constraints, and node1 continues enforcing them
      5. update {A: valid}
      6. node2 scans A and succeeds because it has seen the update
      7. node1 scans A and fails because it hasn’t received the update yet

      This would be an error because the secondary, node1, fails but the primary, node2, will commit the index build.

            Assignee:
            louis.williams@mongodb.com Louis Williams
            Reporter:
            louis.williams@mongodb.com Louis Williams
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: