diff options
author | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2018-07-19 14:10:12 -0400 |
---|---|---|
committer | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2018-07-19 15:36:41 -0400 |
commit | d1a32060ff922f7bc38743484d44dad91cb6b617 (patch) | |
tree | c5526f6934029a1f4733c84c115a181aca46c64e | |
parent | 762e505dd993aae5163f89104055cf72a406a3f8 (diff) | |
download | mongo-d1a32060ff922f7bc38743484d44dad91cb6b617.tar.gz |
SERVER-36025: Remove restart catalog command guard to re-establish the oplog pointer.
`DBHolder::closeAll` will no longer leave the catalog in an inconsistent state. If
it fails, the oplog pointer is now guaranteed to be untouched and otherwise valid.
(cherry picked from commit b813bb3e7bacc146695f42750f4ac2809a1a45cd)
-rw-r--r-- | src/mongo/db/commands/restart_catalog_command.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/mongo/db/commands/restart_catalog_command.cpp b/src/mongo/db/commands/restart_catalog_command.cpp index 8847e04eca9..d7958defdbc 100644 --- a/src/mongo/db/commands/restart_catalog_command.cpp +++ b/src/mongo/db/commands/restart_catalog_command.cpp @@ -103,21 +103,9 @@ public: } } - auto restoreOplogPointerGuard = MakeGuard([opCtx]() { - auto db = DatabaseHolder::getDatabaseHolder().openDb( - opCtx, NamespaceString::kRsOplogNamespace.db()); - invariant(db, "failed to reopen database after early exit from restartCatalog"); - - auto oplog = db->getCollection(opCtx, NamespaceString::kRsOplogNamespace); - invariant(oplog, "failed to get oplog after early exit from restartCatalog"); - repl::establishOplogCollectionForLogging(opCtx, oplog); - }); - log() << "Closing database catalog"; auto state = catalog::closeCatalog(opCtx); - restoreOplogPointerGuard.Dismiss(); - log() << "Reopening database catalog"; catalog::openCatalog(opCtx, state); |