-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Fully Compatible
-
v4.4, v4.2
-
Execution Team 2020-07-13, Execution Team 2020-07-27
Starting mongod with --repair first salvages collections in WiredTiger and then rebuilds all indexes. The salvage operation can recover multiple versions of the same document, so it's possible for a collection to end up with duplicate _id keys. This causes the repair operation to fail, and it becomes impossible to start MongoDB to recover any data.
If an index rebuild fails, we should drop the index and continue. This can be paired with a warning message on startup if an _id index is missing on a collection.
An alternative would be to provide a parameter "repairSkipIndexRebuild" that skips rebuilding all indexes. This easily has the potential to result in having corrupt indexes even if repair succeeds, whereas removing the index and forcing the user to rebuild prevents that problem entirely.
- is related to
-
SERVER-40175 Rebuild any missing _id indexes at startup
- Closed
-
SERVER-49507 Reduce memory consumption in startup repair when rebuilding unique indexes with a large number of duplicate records
- Closed