summaryrefslogtreecommitdiff
path: root/src/mongo/s/move_chunk_request.cpp
diff options
context:
space:
mode:
authorNathan Myers <ncm@asperasoft.com>2016-12-27 23:54:15 -0500
committerNathan Myers <nathan.myers@10gen.com>2017-01-10 11:36:55 -0500
commitda79c6596c6a6e6d818e39b2782968d27cf42be2 (patch)
tree35aa28d5c106bee6acc4921242ae3d3be00a2c64 /src/mongo/s/move_chunk_request.cpp
parent8478c3b4f7c2e2e8804ca4f5a3847b07a71fd9b3 (diff)
downloadmongo-da79c6596c6a6e6d818e39b2782968d27cf42be2.tar.gz
SERVER-27390 Delete dead code in commitChunkMigration
Diffstat (limited to 'src/mongo/s/move_chunk_request.cpp')
-rw-r--r--src/mongo/s/move_chunk_request.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mongo/s/move_chunk_request.cpp b/src/mongo/s/move_chunk_request.cpp
index 1cfa5998c84..67174f71242 100644
--- a/src/mongo/s/move_chunk_request.cpp
+++ b/src/mongo/s/move_chunk_request.cpp
@@ -45,7 +45,7 @@ const char kFromShardId[] = "fromShard";
const char kToShardId[] = "toShard";
const char kMaxChunkSizeBytes[] = "maxChunkSizeBytes";
const char kWaitForDelete[] = "waitForDelete";
-const char kTakeDistLock[] = "takeDistLock";
+const char kTakeDistLock[] = "takeDistLock"; // TODO: delete in 3.8
} // namespace
@@ -134,11 +134,13 @@ StatusWith<MoveChunkRequest> MoveChunkRequest::createFromCommand(NamespaceString
request._maxChunkSizeBytes = static_cast<int64_t>(maxChunkSizeBytes);
}
- {
- Status status =
- bsonExtractBooleanFieldWithDefault(obj, kTakeDistLock, true, &request._takeDistLock);
- if (!status.isOK()) {
- return status;
+ { // TODO: delete this block in 3.8
+ bool takeDistLock = false;
+ Status status = bsonExtractBooleanField(obj, kTakeDistLock, &takeDistLock);
+ if (status.isOK() && takeDistLock) {
+ return Status{ErrorCodes::IncompatibleShardingConfigVersion,
+ str::stream()
+ << "Request received from an older, incompatible mongodb version"};
}
}
@@ -155,8 +157,7 @@ void MoveChunkRequest::appendAsCommand(BSONObjBuilder* builder,
ChunkVersion chunkVersion,
int64_t maxChunkSizeBytes,
const MigrationSecondaryThrottleOptions& secondaryThrottle,
- bool waitForDelete,
- bool takeDistLock) {
+ bool waitForDelete) {
invariant(builder->asTempObj().isEmpty());
invariant(nss.isValid());
@@ -171,7 +172,7 @@ void MoveChunkRequest::appendAsCommand(BSONObjBuilder* builder,
builder->append(kMaxChunkSizeBytes, static_cast<long long>(maxChunkSizeBytes));
secondaryThrottle.append(builder);
builder->append(kWaitForDelete, waitForDelete);
- builder->append(kTakeDistLock, takeDistLock);
+ builder->append(kTakeDistLock, false);
}
bool MoveChunkRequest::operator==(const MoveChunkRequest& other) const {