diff options
author | Alex Taskov <alex.taskov@mongodb.com> | 2020-01-14 21:55:45 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2020-01-14 21:55:45 +0000 |
commit | 169f13aff2b62483e9678409759528a2f9db58e7 (patch) | |
tree | 7c16a1d73667ff1f757c27c1e34bdd5e91a1832d /src/mongo/db/s/start_chunk_clone_request.cpp | |
parent | 846c7aa84ac08dbccc7d727e9068406b7b2de033 (diff) | |
download | mongo-169f13aff2b62483e9678409759528a2f9db58e7.tar.gz |
SERVER-45179 Add the FCV 4.4 behavior to the MigrationDestinationManager
Diffstat (limited to 'src/mongo/db/s/start_chunk_clone_request.cpp')
-rw-r--r-- | src/mongo/db/s/start_chunk_clone_request.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/mongo/db/s/start_chunk_clone_request.cpp b/src/mongo/db/s/start_chunk_clone_request.cpp index ad350452346..30d2813a428 100644 --- a/src/mongo/db/s/start_chunk_clone_request.cpp +++ b/src/mongo/db/s/start_chunk_clone_request.cpp @@ -77,7 +77,8 @@ StatusWith<StartChunkCloneRequest> StartChunkCloneRequest::createFromCommand(Nam // TODO (SERVER-44787): Remove this FCV check after 4.4 is released. if (serverGlobalParams.featureCompatibility.getVersion() == ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44) { - request._migrationId = UUID::parse(obj); + if (obj.getField("uuid")) + request._migrationId = UUID::parse(obj); } { @@ -187,4 +188,31 @@ void StartChunkCloneRequest::appendAsCommand( secondaryThrottle.append(builder); } +// TODO (SERVER-44787): Remove this overload after 4.4 is released. +void StartChunkCloneRequest::appendAsCommand( + BSONObjBuilder* builder, + const NamespaceString& nss, + const MigrationSessionId& sessionId, + const ConnectionString& fromShardConnectionString, + const ShardId& fromShardId, + const ShardId& toShardId, + const BSONObj& chunkMinKey, + const BSONObj& chunkMaxKey, + const BSONObj& shardKeyPattern, + const MigrationSecondaryThrottleOptions& secondaryThrottle) { + invariant(builder->asTempObj().isEmpty()); + invariant(nss.isValid()); + invariant(fromShardConnectionString.isValid()); + + builder->append(kRecvChunkStart, nss.ns()); + sessionId.append(builder); + builder->append(kFromShardConnectionString, fromShardConnectionString.toString()); + builder->append(kFromShardId, fromShardId.toString()); + builder->append(kToShardId, toShardId.toString()); + builder->append(kChunkMinKey, chunkMinKey); + builder->append(kChunkMaxKey, chunkMaxKey); + builder->append(kShardKeyPattern, shardKeyPattern); + secondaryThrottle.append(builder); +} + } // namespace mongo |