summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordi Serra Torrens <jordi.serra-torrens@mongodb.com>2022-11-02 11:24:44 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-02 11:57:08 +0000
commitdf0a6fa58d1cec0f26c221e81a42843e61086f03 (patch)
tree38bee0fbc03618255330ff9c41610821d716a87a
parent64c4305a9b1f4149c08c3eb91d31e749d24d2e56 (diff)
downloadmongo-df0a6fa58d1cec0f26c221e81a42843e61086f03.tar.gz
SERVER-71010 Initialize CollectionShardingStateFactory on BM_UnshardedDestinedRecipient
-rw-r--r--src/mongo/db/s/sharding_write_router_bm.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/s/sharding_write_router_bm.cpp b/src/mongo/db/s/sharding_write_router_bm.cpp
index e92d8292052..89fa3ded04d 100644
--- a/src/mongo/db/s/sharding_write_router_bm.cpp
+++ b/src/mongo/db/s/sharding_write_router_bm.cpp
@@ -38,6 +38,7 @@
#include "mongo/db/s/collection_metadata.h"
#include "mongo/db/s/collection_sharding_runtime.h"
#include "mongo/db/s/collection_sharding_state_factory_shard.h"
+#include "mongo/db/s/collection_sharding_state_factory_standalone.h"
#include "mongo/db/s/operation_sharding_state.h"
#include "mongo/db/s/sharding_state.h"
#include "mongo/db/s/sharding_write_router.h"
@@ -214,6 +215,10 @@ void BM_UnshardedDestinedRecipient(benchmark::State& state) {
serviceContext->registerClientObserver(std::make_unique<LockerNoopClientObserver>());
const auto opCtx = client->makeOperationContext();
+ CollectionShardingStateFactory::set(
+ opCtx->getServiceContext(),
+ std::make_unique<CollectionShardingStateFactoryStandalone>(opCtx->getServiceContext()));
+
const auto catalogCache = CatalogCacheMock::make();
for (auto keepRunning : state) {