[SERVER-46659] Make initial sync work with two phase index builds + commit quorum on Created: 05/Mar/20  Updated: 29/Oct/23  Resolved: 21/Apr/20

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.4.0-rc4, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Suganthi Mani Assignee: Gregory Wlodarek
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on SERVER-46557 Commit quorum value can get lost when... Closed
depends on SERVER-47517 Secondaries will always try to vote i... Closed
depends on SERVER-47155 Limit the number of simultaneous inde... Closed
is depended on by SERVER-46658 Implement commit quorum option "all" Closed
is depended on by SERVER-46823 Enable default for index commit quoru... Closed
is depended on by SERVER-47163 Do not start an index build if it doe... Closed
Problem/Incident
causes SERVER-47700 renameCollection should check if the ... Closed
Related
related to SERVER-47842 [4.4] listIndexes with includeBuildUU... Closed
related to SERVER-39453 Add initial sync support for simultan... Closed
related to SERVER-58280 initial sync hangs on hiding dropped ... Closed
is related to SERVER-60606 Race condition during initial sync wh... Closed
is related to SERVER-39423 secondaries already possessing an ind... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Execution Team 2020-03-23, Execution Team 2020-04-06, Execution Team 2020-04-20, Execution Team 2020-05-04
Participants:
Linked BF Score: 50

 Description   

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.



 Comments   
Comment by Githook User [ 30/Apr/20 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-46659 Initial sync will startup two phase index builds during the collection cloning phase to prevent a scenario where the commit quorum cannot be satisfied due to the primary node needing the initial syncing nodes vote

(cherry picked from commit b957b68205fbf672867cf68e30c0744ac5abfb9f)

SERVER-47700 renameCollection should check if the target collection exists before accessing the collection object

(cherry picked from commit a6424fafa179805e192dc354cae85fdf0359f95e)
Branch: v4.4
https://github.com/mongodb/mongo/commit/8dc854b5354ad2a2d236575b00c8e4a1c871952f

Comment by Githook User [ 20/Apr/20 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-46659 Initial sync will startup two phase index builds during the collection cloning phase to prevent a scenario where the commit quorum cannot be satisfied due to the primary node needing the initial syncing nodes vote
Branch: master
https://github.com/mongodb/mongo/commit/b957b68205fbf672867cf68e30c0744ac5abfb9f

Generated at Thu Feb 08 05:12:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.