[SERVER-65677] Use validate repair mode to fix duplicate keys Created: 14/Apr/22  Updated: 29/Oct/23  Resolved: 06/Dec/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

Type: Task Priority: Major - P3
Reporter: Yuhong Zhang Assignee: Will Buerger
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-62258 Add heuristic when repairing duplicat... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2022-10-17, Execution Team 2022-10-31, Execution Team 2022-11-14, Execution Team 2022-12-12, Execution Team 2022-11-28
Participants:

 Description   

Currently validate doesn't remove any documents if there are duplicate records with matching index entries. When we have duplicate records that are both missing index entries in a unique index, we want to only keep one to insert into the index and the other is moved to lost and found. Usually we would want to remove the older document and keep the new one. Even if it's not the case, the users can still find the removed document in lost-and-found collection. 

This solution may be more arbitrary for clustered indexes as the record id can be specified by the user. But we should just make the solution consistent and warn users about it.



 Comments   
Comment by Githook User [ 08/Dec/22 ]

Author:

{'name': 'Will Buerger', 'email': 'will.buerger@mongodb.com', 'username': 'wbuerger46'}

Message: SERVER-65677: Use validate repair mode to fix duplicate keys
Branch: master
https://github.com/mongodb/mongo/commit/b73ce880aeab9297bca05fd29c3f2c351a645f28

Comment by Elizabeth Roytburd [ 17/Oct/22 ]

Sending back into triage now that Adrian is rotating with Server Security. 

Generated at Thu Feb 08 06:03:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.