diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2022-03-02 04:26:46 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-04 16:58:17 +0000 |
commit | 078acc6b8f55faa58ad794021b40ee47a528c035 (patch) | |
tree | 01836508eee88753e01d961cad6b4d1f4beebd2f /src/mongo/db/catalog | |
parent | 1dc6b8b8a944211153e7264cffde2b2a0825cfe6 (diff) | |
download | mongo-078acc6b8f55faa58ad794021b40ee47a528c035.tar.gz |
SERVER-63787 Add point-in-time functionality to replica set end-to-end tests
Diffstat (limited to 'src/mongo/db/catalog')
-rw-r--r-- | src/mongo/db/catalog/database_impl.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/db/catalog/database_impl.cpp b/src/mongo/db/catalog/database_impl.cpp index 16d77cf9f14..31c1937ead2 100644 --- a/src/mongo/db/catalog/database_impl.cpp +++ b/src/mongo/db/catalog/database_impl.cpp @@ -223,10 +223,9 @@ Status DatabaseImpl::init(OperationContext* const opCtx) { } } - // When in restore mode, views created on collections that weren't restored will be removed. - if (storageGlobalParams.restore) { - invariant(opCtx->lockState()->isW()); - + // When in restore mode, views created on collections that weren't restored will be removed. We + // only do this during startup when the global lock is held. + if (storageGlobalParams.restore && opCtx->lockState()->isW()) { // Refresh our copy of the catalog, since we may have modified it above. catalog = CollectionCatalog::get(opCtx); try { |