summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gottlieb <daniel.gottlieb@mongodb.com>2018-07-19 14:10:12 -0400
committerDaniel Gottlieb <daniel.gottlieb@mongodb.com>2018-07-19 15:36:41 -0400
commitd1a32060ff922f7bc38743484d44dad91cb6b617 (patch)
treec5526f6934029a1f4733c84c115a181aca46c64e
parent762e505dd993aae5163f89104055cf72a406a3f8 (diff)
downloadmongo-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.cpp12
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);