[SERVER-36623] Do not rebuild indexes before repairing databases Created: 13/Aug/18  Updated: 29/Oct/23  Resolved: 14/Aug/18

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.0.2, 4.1.3

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

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0
Sprint: Storage NYC 2018-08-27
Participants:

 Description   

repairDatabaseAndCheckVersion calls rebuildIndexes before attempting to call repairDatabase (which also rebuild indexes).

If there are indexes to rebuild, this will trigger a null pointer dereference as a result of setting the RecordStore to nullptr (intentionally) when the catalog initializes the collections when started with --repair.

Indexes will be rebuilt if reconcileCatalogAndIdents has an index in the catalog that does not exist in the storage engine. This would normally be safe when starting from an unclean shutdown.

If the database is started with --repair, do not call rebuildIndexes before repairing databases.



 Comments   
Comment by Githook User [ 15/Aug/18 ]

Author:

{'username': 'louiswilliams', 'email': 'louis.williams@mongodb.com', 'name': 'Louis Williams'}

Message: SERVER-36623 Do not rebuild indexes before repairing databases

(cherry picked from commit 4028ee62650cde8be1409ffe54bd4d40328c241c)
Branch: v4.0
https://github.com/mongodb/mongo/commit/ed04908ffce0e6d53f0982827e7c988b54cd1940

Comment by Githook User [ 14/Aug/18 ]

Author:

{'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}

Message: SERVER-36623 Do not rebuild indexes before repairing databases
Branch: master
https://github.com/mongodb/mongo/commit/4028ee62650cde8be1409ffe54bd4d40328c241c

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