summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-07-13 18:00:41 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-07-23 10:45:04 -0400
commit7c90c54e1115710c8f5c2246074ab5b9729c5422 (patch)
treefb1ebd7d45ab3b4c99512a5ea01a38ff7574d3cc
parente00b7670f274bad696c3a6b89884895c9664031f (diff)
downloadmongo-7c90c54e1115710c8f5c2246074ab5b9729c5422.tar.gz
SERVER-36132 Invariant that chunk migration is actually reflected in the metadata after successful commit
(cherry picked from commit 1c0bce5f9792f0f6d4f26cd041a0c60c0398bd5e)
-rw-r--r--src/mongo/db/s/migration_source_manager.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mongo/db/s/migration_source_manager.cpp b/src/mongo/db/s/migration_source_manager.cpp
index 142e372cb75..f21f18da507 100644
--- a/src/mongo/db/s/migration_source_manager.cpp
+++ b/src/mongo/db/s/migration_source_manager.cpp
@@ -561,6 +561,23 @@ Status MigrationSourceManager::commitChunkMetadataOnConfig(OperationContext* opC
}
if (refreshedMetadata->keyBelongsToMe(_args.getMinKey())) {
+ // This condition may only happen if the migration commit has failed for any reason
+ if (migrationCommitStatus.isOK()) {
+ severe() << "The migration commit succeeded, but the new chunk placement was not "
+ "reflected after metadata refresh, which is an indication of an "
+ "afterOpTime bug.";
+ severe() << "The current config server opTime is " << Grid::get(opCtx)->configOpTime();
+ severe() << "The commit response came from "
+ << redact(commitChunkMigrationResponse.getValue().hostAndPort->toString())
+ << " and contained:";
+ severe() << " metadata: "
+ << redact(commitChunkMigrationResponse.getValue().metadata.toString());
+ severe() << " response: "
+ << redact(commitChunkMigrationResponse.getValue().response.toString());
+
+ fassertFailed(50878);
+ }
+
// The chunk modification was not applied, so report the original error
return migrationCommitStatus.withContext("Chunk move was not successful");
}