[SERVER-39647] Delete duplicate documents before committing the _id index during initial sync Created: 18/Feb/19  Updated: 29/Oct/23  Resolved: 22/Feb/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.1.8
Fix Version/s: 4.1.9

Type: Bug Priority: Major - P3
Reporter: Louis Williams Assignee: Gregory Wlodarek
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage NYC 2019-02-25
Participants:
Linked BF Score: 50

 Description   

During the collection cloning phase, the _id index build should not be committed before  duplicate documents are deleted here. This is because after the index is committed, it is possible to unindex a record with the same key, but a different RecordId.

To make this work, the following straightforward changes will also need to be made:

  • call drainBackgroundWrites and checkConstraints before committing the index build. This is because the prior call to deleteDocument performs a side write that must be drained
  • update requiresGhostCommitTimestampForWrite to return false if the member is in the STARTUP2 state. This is because lastApplied is not available in at this phase of initial sync.
  • don't pass secDups for non-_id indexes here. This is an existing bug because it's possible for the x_1 index to have duplicates, which should be ignored. Unfortunately because the number of initial sync attempts defaulted to 10, this was not evident.
  • the initial syncing node must only have 1 attempt in this test. Pass the numInitialSyncAttempts=1 setParameter when adding the node here.


 Comments   
Comment by Githook User [ 22/Feb/19 ]

Author:

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

Message: SERVER-39647 Delete duplicate documents before committing the _id index during initial sync
Branch: master
https://github.com/mongodb/mongo/commit/4ac8553ce4e6cb07e0615b9c236abe18c430d68f

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