summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2017-07-21 10:17:57 -0400
committerEsha Maharishi <esha.maharishi@mongodb.com>2017-07-21 10:18:59 -0400
commitaeccd2c8b429f4f3f81f5fb8e048ddb58fd0749a (patch)
tree37b9a270f2cfef7b3dfae3ae6d31287bff5c333c
parent2a8317c052e8a5e44a8816796b6201f30bcd8bfa (diff)
downloadmongo-aeccd2c8b429f4f3f81f5fb8e048ddb58fd0749a.tar.gz
SERVER-29876 moveChunk command ignores '_waitForDelete' option
-rw-r--r--src/mongo/s/commands/cluster_move_chunk_cmd.cpp3
-rw-r--r--src/mongo/s/move_chunk_request.cpp10
-rw-r--r--src/mongo/s/request_types/balance_chunk_request_type.cpp10
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 =