diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-01-17 07:34:52 -0500 |
---|---|---|
committer | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2019-01-17 09:43:52 -0500 |
commit | 33dc565a28292f02b1a304c5c418463226fa7bcb (patch) | |
tree | 5a2b82a44d87688e5de8fe0300180d705f35e30e /src/mongo/db/repair_database.cpp | |
parent | 6fe1c12a764ed7b615399531e819b25a9d205993 (diff) | |
download | mongo-33dc565a28292f02b1a304c5c418463226fa7bcb.tar.gz |
SERVER-39063 Remove duplicate collection repair code
Diffstat (limited to 'src/mongo/db/repair_database.cpp')
-rw-r--r-- | src/mongo/db/repair_database.cpp | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/src/mongo/db/repair_database.cpp b/src/mongo/db/repair_database.cpp index abbb2e94b6f..56f7dd433d2 100644 --- a/src/mongo/db/repair_database.cpp +++ b/src/mongo/db/repair_database.cpp @@ -260,6 +260,8 @@ Status repairCollections(OperationContext* opCtx, status = rebuildIndexesOnCollection(opCtx, dbce, cce, swIndexNameObjs.getValue()); if (!status.isOK()) return status; + + engine->flushAllFiles(opCtx, true); } return Status::OK(); } @@ -312,34 +314,6 @@ Status repairDatabase(OperationContext* opCtx, StorageEngine* engine, const std: return status; } - DatabaseCatalogEntry* dbce = engine->getDatabaseCatalogEntry(opCtx, dbName); - - std::list<std::string> colls; - dbce->getCollectionNamespaces(&colls); - - for (std::list<std::string>::const_iterator it = colls.begin(); it != colls.end(); ++it) { - // Don't check for interrupt after starting to repair a collection otherwise we can - // leave data in an inconsistent state. Interrupting between collections is ok, however. - opCtx->checkForInterrupt(); - - log() << "Repairing collection " << *it; - - Status status = engine->repairRecordStore(opCtx, *it); - if (!status.isOK()) - return status; - - CollectionCatalogEntry* cce = dbce->getCollectionCatalogEntry(*it); - auto swIndexNameObjs = getIndexNameObjs(opCtx, dbce, cce); - if (!swIndexNameObjs.isOK()) - return swIndexNameObjs.getStatus(); - - status = rebuildIndexesOnCollection(opCtx, dbce, cce, swIndexNameObjs.getValue()); - if (!status.isOK()) - return status; - - engine->flushAllFiles(opCtx, true); - } - return Status::OK(); } } // namespace mongo |