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

Make initial sync work with two phase index builds + commit quorum on

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.4.0-rc4, 4.7.0
    • Affects Version/s: None
    • Component/s: Storage
    • None
    • Fully Compatible
    • ALL
    • v4.4
    • Execution Team 2020-03-23, Execution Team 2020-04-06, Execution Team 2020-04-20, Execution Team 2020-05-04
    • 50

      Currently initial sync ignores any in-progress 2 phase index builds. Only if it sees commitIndexBuild oplog entry during the initial sync oplog replay or during secondary oplog application, the index build gets started and committed. Now, the problem is that, for two phase index builds with commit quorum on, the primary can commit the index build only if my number of ready to commit votes satisfy commit quorum value.

      Let's assume my commit quorum is "all" and its a 2 node replica set. To be noted, In our today's world, initial syncing nodes can vote, as a result. so consider the below scenario.
      1) Node A is primary
      2) Node B starts performing initial sync.
      3) Primary(node A) starts the index build 'x_1' for collection foo.bar and votes for itself.
      4) Node B ignores building/in-progress 'x_1' during initial sync.
      5) Node B finishes initial sync.
      6) Since Index build 'x_1' has received only one vote < ("all" = 2), so it can't commit the index build and keeps waiting for the votes from secondary(Node B) forever.

            Assignee:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Reporter:
            suganthi.mani@mongodb.com Suganthi Mani
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: