summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/config/configsvr_remove_chunks_command.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/config/configsvr_remove_chunks_command.cpp')
-rw-r--r--src/mongo/db/s/config/configsvr_remove_chunks_command.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mongo/db/s/config/configsvr_remove_chunks_command.cpp b/src/mongo/db/s/config/configsvr_remove_chunks_command.cpp
index c54390d759a..a842c597425 100644
--- a/src/mongo/db/s/config/configsvr_remove_chunks_command.cpp
+++ b/src/mongo/db/s/config/configsvr_remove_chunks_command.cpp
@@ -35,6 +35,7 @@
#include "mongo/db/commands.h"
#include "mongo/db/dbdirectclient.h"
#include "mongo/db/repl/repl_client_info.h"
+#include "mongo/db/s/config/sharding_catalog_manager.h"
#include "mongo/db/s/remove_chunks_gen.h"
#include "mongo/db/session/session_catalog_mongod.h"
#include "mongo/db/transaction/transaction_participant.h"
@@ -94,13 +95,13 @@ public:
// Write with localWriteConcern because we cannot wait for replication with a
// session checked out. The command will wait for majority WC on the epilogue after
// the session has been checked in.
- uassertStatusOK(
- Grid::get(newOpCtxPtr.get())
- ->catalogClient()
- ->removeConfigDocuments(newOpCtxPtr.get(),
- ChunkType::ConfigNS,
- BSON(ChunkType::collectionUUID << collectionUUID),
- ShardingCatalogClient::kLocalWriteConcern));
+ const auto catalogClient =
+ ShardingCatalogManager::get(newOpCtxPtr.get())->localCatalogClient();
+ uassertStatusOK(catalogClient->removeConfigDocuments(
+ newOpCtxPtr.get(),
+ ChunkType::ConfigNS,
+ BSON(ChunkType::collectionUUID << collectionUUID),
+ ShardingCatalogClient::kLocalWriteConcern));
}
// Since we no write happened on this txnNumber, we need to make a dummy write so that