diff options
author | Mihai Andrei <mihai.andrei@mongodb.com> | 2019-12-20 23:05:39 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-12-20 23:05:39 +0000 |
commit | 4dc5811a2c427f35ae9dfe5cd110dcdf318bcf9d (patch) | |
tree | f3d679fc7a1dcf9825a1c086a3fede561d250d79 /src/mongo/db/s/migration_destination_manager_legacy_commands.cpp | |
parent | c9df281977929fdfead5ca501f68e0a6e30cdc94 (diff) | |
download | mongo-4dc5811a2c427f35ae9dfe5cd110dcdf318bcf9d.tar.gz |
SERVER-44914 A shard receiving its first chunk should locally drop any indexes not on the donor
Diffstat (limited to 'src/mongo/db/s/migration_destination_manager_legacy_commands.cpp')
-rw-r--r-- | src/mongo/db/s/migration_destination_manager_legacy_commands.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp b/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp index 2cd586063af..acfdbb306f1 100644 --- a/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp +++ b/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp @@ -98,8 +98,6 @@ public: const auto chunkRange = uassertStatusOK(ChunkRange::fromBSON(cmdObj)); - const auto shardVersion = forceShardFilteringMetadataRefresh(opCtx, nss); - const auto writeConcern = uassertStatusOK(ChunkMoveWriteConcernOptions::getEffectiveWriteConcern( opCtx, cloneRequest.getSecondaryThrottle())); @@ -109,6 +107,10 @@ public: uassertStatusOK(ActiveMigrationsRegistry::get(opCtx).registerReceiveChunk( nss, chunkRange, cloneRequest.getFromShardId()))); + // We force a refresh immediately after registering this migration to guarantee that this + // shard will not receive a chunk after refreshing. + const auto shardVersion = forceShardFilteringMetadataRefresh(opCtx, nss); + uassertStatusOK( MigrationDestinationManager::get(opCtx)->start(opCtx, nss, |