From fa32d665bd63de7a9d246fa99df5e30840a931de Mon Sep 17 00:00:00 2001 From: Henrik Edin Date: Tue, 5 Apr 2022 13:25:46 +0000 Subject: 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. --- src/mongo/db/index/SConscript | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mongo/db/index/SConscript') diff --git a/src/mongo/db/index/SConscript b/src/mongo/db/index/SConscript index b4e2e698104..410c0a2825c 100644 --- a/src/mongo/db/index/SConscript +++ b/src/mongo/db/index/SConscript @@ -111,6 +111,7 @@ serveronlyEnv.Library( '$BUILD_DIR/mongo/db/storage/execution_context', '$BUILD_DIR/mongo/db/storage/index_entry_comparison', '$BUILD_DIR/mongo/db/storage/key_string', + '$BUILD_DIR/mongo/db/storage/record_store_base', '$BUILD_DIR/mongo/db/storage/storage_options', '$BUILD_DIR/mongo/db/vector_clock', '$BUILD_DIR/mongo/idl/server_parameter', -- cgit v1.2.1