diff options
author | Henrik Edin <henrik.edin@mongodb.com> | 2022-04-05 13:25:46 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-04-05 14:17:12 +0000 |
commit | fa32d665bd63de7a9d246fa99df5e30840a931de (patch) | |
tree | fbe101ea2f8888e6361acfb14f220d2fa8eeace4 /src/mongo/dbtests/counttests.cpp | |
parent | 4a594750742b3620dba3696cb6e91d60aa8d0df6 (diff) | |
download | mongo-fa32d665bd63de7a9d246fa99df5e30840a931de.tar.gz |
SERVER-52877 Unify how writable Collections instances are handled
CollectionCatalog::LifetimeMode has been removed. Catalog writes now
require that we are in an active WUOW.
Make it allowed to use WriteUnitOfWork when the server is in readOnly
mode. It does not open storage sessions, just allows registration of
RecoveryUnit callbacks that are executed when calling commit(). This
allows for the unification of code where we need to initialize Collection
instances even in readOnly mode.
Handling of enforcing readOnly has been pushed down to the RecordStore.
All interfaces that perform write now check if we are in readOnly mode
and throw if we are.
Catalog updates using the BatchedCollectionCatalogWriter class bypass
the Collection cloning if the batched CollectionCatalog instance already
has a uniquely owned copy (a previous write to this collection has been
requested). It is also not required to be in an active WUOW when the
BatchedCollectionCatalogWriter is used.
Diffstat (limited to 'src/mongo/dbtests/counttests.cpp')
-rw-r--r-- | src/mongo/dbtests/counttests.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/dbtests/counttests.cpp b/src/mongo/dbtests/counttests.cpp index 45318587cc2..3cdec3af294 100644 --- a/src/mongo/dbtests/counttests.cpp +++ b/src/mongo/dbtests/counttests.cpp @@ -53,7 +53,7 @@ public: auto collection = CollectionCatalog::get(&_opCtx)->lookupCollectionByNamespaceForMetadataWrite( - &_opCtx, CollectionCatalog::LifetimeMode::kManagedInWriteUnitOfWork, nss()); + &_opCtx, nss()); if (collection) { _database->dropCollection(&_opCtx, nss()).transitional_ignore(); } |