diff options
author | Esha Maharishi <esha.maharishi@mongodb.com> | 2017-07-21 10:17:57 -0400 |
---|---|---|
committer | Esha Maharishi <esha.maharishi@mongodb.com> | 2017-07-21 10:18:59 -0400 |
commit | aeccd2c8b429f4f3f81f5fb8e048ddb58fd0749a (patch) | |
tree | 37b9a270f2cfef7b3dfae3ae6d31287bff5c333c | |
parent | 2a8317c052e8a5e44a8816796b6201f30bcd8bfa (diff) | |
download | mongo-aeccd2c8b429f4f3f81f5fb8e048ddb58fd0749a.tar.gz |
SERVER-29876 moveChunk command ignores '_waitForDelete' option
-rw-r--r-- | src/mongo/s/commands/cluster_move_chunk_cmd.cpp | 3 | ||||
-rw-r--r-- | src/mongo/s/move_chunk_request.cpp | 10 | ||||
-rw-r--r-- | src/mongo/s/request_types/balance_chunk_request_type.cpp | 10 |
3 files changed, 22 insertions, 1 deletions
diff --git a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp index 23351cf92a5..142986e9831 100644 --- a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp +++ b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp @@ -193,7 +193,8 @@ public: to->getId(), maxChunkSizeBytes, secondaryThrottle, - cmdObj["_waitForDelete"].trueValue())); + cmdObj["_waitForDelete"].trueValue() || + cmdObj["waitForDelete"].trueValue())); Grid::get(opCtx)->catalogCache()->onStaleConfigError(std::move(routingInfo)); diff --git a/src/mongo/s/move_chunk_request.cpp b/src/mongo/s/move_chunk_request.cpp index 1cfa5998c84..4622f26fd29 100644 --- a/src/mongo/s/move_chunk_request.cpp +++ b/src/mongo/s/move_chunk_request.cpp @@ -45,6 +45,7 @@ const char kFromShardId[] = "fromShard"; const char kToShardId[] = "toShard"; const char kMaxChunkSizeBytes[] = "maxChunkSizeBytes"; const char kWaitForDelete[] = "waitForDelete"; +const char kWaitForDeleteDeprecated[] = "_waitForDelete"; const char kTakeDistLock[] = "takeDistLock"; } // namespace @@ -124,6 +125,15 @@ StatusWith<MoveChunkRequest> MoveChunkRequest::createFromCommand(NamespaceString } } + // Check for the deprecated name '_waitForDelete' if 'waitForDelete' was false. + if (!request._waitForDelete) { + Status status = bsonExtractBooleanFieldWithDefault( + obj, kWaitForDeleteDeprecated, false, &request._waitForDelete); + if (!status.isOK()) { + return status; + } + } + { long long maxChunkSizeBytes; Status status = bsonExtractIntegerField(obj, kMaxChunkSizeBytes, &maxChunkSizeBytes); diff --git a/src/mongo/s/request_types/balance_chunk_request_type.cpp b/src/mongo/s/request_types/balance_chunk_request_type.cpp index dbf40ddea43..520703459f5 100644 --- a/src/mongo/s/request_types/balance_chunk_request_type.cpp +++ b/src/mongo/s/request_types/balance_chunk_request_type.cpp @@ -43,6 +43,7 @@ const char kMaxChunkSizeBytes[] = "maxChunkSizeBytes"; const char kToShardId[] = "toShard"; const char kSecondaryThrottle[] = "secondaryThrottle"; const char kWaitForDelete[] = "waitForDelete"; +const char kWaitForDeleteDeprecated[] = "_waitForDelete"; const WriteConcernOptions kMajorityWriteConcernNoTimeout(WriteConcernOptions::kMajority, WriteConcernOptions::SyncMode::UNSET, @@ -94,6 +95,15 @@ StatusWith<BalanceChunkRequest> BalanceChunkRequest::parseFromConfigCommand(cons } } + // Check for the deprecated name '_waitForDelete' if 'waitForDelete' was false. + if (!request._waitForDelete) { + Status status = bsonExtractBooleanFieldWithDefault( + obj, kWaitForDeleteDeprecated, false, &request._waitForDelete); + if (!status.isOK()) { + return status; + } + } + { long long maxChunkSizeBytes; Status status = |