summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2021-10-06 01:00:53 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-06 01:33:27 +0000
commit6994c2d5b03da3b8c3718e2203699d8b3fc2b72a (patch)
tree07cd2f57601fb18bb5b623800e8c7c17a4b0c8d3
parent87358266d9768d1afbd2d64501ab364940a807b4 (diff)
downloadmongo-6994c2d5b03da3b8c3718e2203699d8b3fc2b72a.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.cpp12
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