summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/count_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/count_cmd.cpp')
-rw-r--r--src/mongo/db/commands/count_cmd.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/commands/count_cmd.cpp b/src/mongo/db/commands/count_cmd.cpp
index 9a4fd7ff529..50cd6752024 100644
--- a/src/mongo/db/commands/count_cmd.cpp
+++ b/src/mongo/db/commands/count_cmd.cpp
@@ -152,7 +152,8 @@ public:
// Prevent chunks from being cleaned up during yields - this allows us to only check the
// version on initial entry into count.
- auto rangePreserver = CollectionShardingState::get(opCtx, nss)->getCurrentMetadata();
+ auto rangePreserver =
+ CollectionShardingState::get(opCtx, nss)->getMetadataForOperation(opCtx);
auto statusWithPlanExecutor =
getExecutorCount(opCtx, collection, request.getValue(), true /*explain*/);
@@ -205,7 +206,8 @@ public:
// Prevent chunks from being cleaned up during yields - this allows us to only check the
// version on initial entry into count.
- auto rangePreserver = CollectionShardingState::get(opCtx, nss)->getCurrentMetadata();
+ auto rangePreserver =
+ CollectionShardingState::get(opCtx, nss)->getMetadataForOperation(opCtx);
auto statusWithPlanExecutor =
getExecutorCount(opCtx, collection, request.getValue(), false /*explain*/);