summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp
diff options
context:
space:
mode:
authorHaley Connelly <haley.connelly@mongodb.com>2021-12-20 23:51:23 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-12-21 00:32:35 +0000
commit3130c8146113e2c2efb4615cf93630f42fd9f1bf (patch)
treebba701f19253e4ba2c32e8309db1a4b702338a57 /src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp
parent60c56d04a121194e16884eed520eb0676cbf0261 (diff)
downloadmongo-3130c8146113e2c2efb4615cf93630f42fd9f1bf.tar.gz
SERVER-60123 Support sharding by cluster key _id on explicitly created clustered collection
Diffstat (limited to 'src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp')
-rw-r--r--src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp
index bb8eb56e260..6654e34db36 100644
--- a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp
+++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp
@@ -857,15 +857,15 @@ MigrationChunkClonerSourceLegacy::_getIndexScanExecutor(
// We can afford to yield here because any change to the base data that we might miss is already
// being queued and will migrate in the 'transferMods' stage.
- return InternalPlanner::indexScan(opCtx,
- &collection,
- shardKeyIdx,
- min,
- max,
- BoundInclusion::kIncludeStartKeyOnly,
- PlanYieldPolicy::YieldPolicy::YIELD_AUTO,
- InternalPlanner::Direction::FORWARD,
- scanOption);
+ return InternalPlanner::shardKeyIndexScan(opCtx,
+ &collection,
+ *shardKeyIdx,
+ min,
+ max,
+ BoundInclusion::kIncludeStartKeyOnly,
+ PlanYieldPolicy::YieldPolicy::YIELD_AUTO,
+ InternalPlanner::Direction::FORWARD,
+ scanOption);
}
Status MigrationChunkClonerSourceLegacy::_storeCurrentLocs(OperationContext* opCtx) {
@@ -942,8 +942,8 @@ Status MigrationChunkClonerSourceLegacy::_storeCurrentLocs(OperationContext* opC
uint64_t averageObjectIdSize = 0;
const uint64_t defaultObjectIdSize = OID::kOIDSize;
- // For a time series collection, an index on '_id' is not required.
- if (totalRecs > 0 && !collection->getTimeseriesOptions()) {
+ // For clustered collection, an index on '_id' is not required.
+ if (totalRecs > 0 && !collection->isClustered()) {
const auto idIdx = collection->getIndexCatalog()->findIdIndex(opCtx)->getEntry();
if (!idIdx) {
return {ErrorCodes::IndexNotFound,