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, 2 insertions, 4 deletions
diff --git a/src/mongo/db/commands/count_cmd.cpp b/src/mongo/db/commands/count_cmd.cpp
index 50cd6752024..9a4fd7ff529 100644
--- a/src/mongo/db/commands/count_cmd.cpp
+++ b/src/mongo/db/commands/count_cmd.cpp
@@ -152,8 +152,7 @@ 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)->getMetadataForOperation(opCtx);
+ auto rangePreserver = CollectionShardingState::get(opCtx, nss)->getCurrentMetadata();
auto statusWithPlanExecutor =
getExecutorCount(opCtx, collection, request.getValue(), true /*explain*/);
@@ -206,8 +205,7 @@ 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)->getMetadataForOperation(opCtx);
+ auto rangePreserver = CollectionShardingState::get(opCtx, nss)->getCurrentMetadata();
auto statusWithPlanExecutor =
getExecutorCount(opCtx, collection, request.getValue(), false /*explain*/);