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

Use validate repair mode to fix duplicate keys

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • 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

      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.

            Assignee:
            will.buerger@mongodb.com Will Buerger
            Reporter:
            yuhong.zhang@mongodb.com Yuhong Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: