diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2021-10-05 23:39:34 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-10-06 01:24:02 +0000 |
commit | 96c21d4b1af352eacb9350ad6d8b6ebaa17369fd (patch) | |
tree | 95cd415f98f690a9b8606fd73a19d2d04d444b62 | |
parent | e7092e40c952cd3a97bfda5ccb146fa1ecd0df56 (diff) | |
download | mongo-96c21d4b1af352eacb9350ad6d8b6ebaa17369fd.tar.gz |
Revert "SERVER-59819 Avoid timeout in collection_catalog_bm setup"
This reverts commit 6ece75f2fd3e23d493ff72e63e9601b46b261659.
-rw-r--r-- | src/mongo/db/catalog/collection_catalog_bm.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/mongo/db/catalog/collection_catalog_bm.cpp b/src/mongo/db/catalog/collection_catalog_bm.cpp index 8ea27023d49..2452f4f3a39 100644 --- a/src/mongo/db/catalog/collection_catalog_bm.cpp +++ b/src/mongo/db/catalog/collection_catalog_bm.cpp @@ -49,21 +49,15 @@ ServiceContext* setupServiceContext() { } void createCollectionsAndLocker(OperationContext* opCtx, int numCollections) { - { - stdx::lock_guard<Client> lk(cc()); - opCtx->swapLockState(std::make_unique<LockerImpl>(), lk); - } - - // Register new collections under the exclusive global lock to avoid the copy-on-write mechanism - // during the benchmark setup. - Lock::GlobalLock globalLk(opCtx, MODE_X); - for (auto i = 0; i < numCollections; i++) { const NamespaceString nss("collection_catalog_bm", std::to_string(i)); CollectionCatalog::write(opCtx, [&](CollectionCatalog& catalog) { catalog.registerCollection(opCtx, UUID::gen(), std::make_shared<CollectionMock>(nss)); }); } + + stdx::lock_guard<Client> lk(cc()); + opCtx->swapLockState(std::make_unique<LockerImpl>(), lk); } } // namespace |