summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/migration_destination_manager.cpp
diff options
context:
space:
mode:
authorAllison Easton <allison.easton@mongodb.com>2022-11-23 16:06:22 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-23 16:33:06 +0000
commitd5209179dc52ac6411f8fcacb1b9405fe617d8a5 (patch)
tree917f8b89998e77aefecc7946a42db149f3e0a741 /src/mongo/db/s/migration_destination_manager.cpp
parent9114c3335f84c500eb767d06b7960eeff2802a56 (diff)
downloadmongo-d5209179dc52ac6411f8fcacb1b9405fe617d8a5.tar.gz
SERVER-70382 Replace boost::none index versions with the actual index version from the catalog cache or CSR
Diffstat (limited to 'src/mongo/db/s/migration_destination_manager.cpp')
-rw-r--r--src/mongo/db/s/migration_destination_manager.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mongo/db/s/migration_destination_manager.cpp b/src/mongo/db/s/migration_destination_manager.cpp
index 9e3e3a095af..a5d5fbb0fd0 100644
--- a/src/mongo/db/s/migration_destination_manager.cpp
+++ b/src/mongo/db/s/migration_destination_manager.cpp
@@ -798,7 +798,7 @@ MigrationDestinationManager::IndexesAndIdIndex MigrationDestinationManager::getC
OperationContext* opCtx,
const NamespaceStringOrUUID& nssOrUUID,
const ShardId& fromShardId,
- const boost::optional<ChunkManager>& cm,
+ const boost::optional<CollectionRoutingInfo>& cri,
boost::optional<Timestamp> afterClusterTime) {
auto fromShard =
uassertStatusOK(Grid::get(opCtx)->shardRegistry()->getShard(opCtx, fromShardId));
@@ -813,10 +813,8 @@ MigrationDestinationManager::IndexesAndIdIndex MigrationDestinationManager::getC
auto cmd = nssOrUUID.nss() ? BSON("listIndexes" << nssOrUUID.nss()->coll())
: BSON("listIndexes" << *nssOrUUID.uuid());
- if (cm) {
- ChunkVersion placementVersion = cm->getVersion(fromShardId);
- cmd = appendShardVersion(
- cmd, ShardVersion(placementVersion, boost::optional<CollectionIndexes>(boost::none)));
+ if (cri) {
+ cmd = appendShardVersion(cmd, cri->getShardVersion(fromShardId));
}
if (afterClusterTime) {
cmd = cmd.addFields(makeLocalReadConcernWithAfterClusterTime(*afterClusterTime));