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-25 14:27:30 -0400
commit68392eb9672020b6e1e784450d75c098d243c7ef (patch)
treeeb7590166391dc6ee82ad98fd3ce01b7a950651e
parentb48a9b555693e6f74ee9214779d78ad52929140a (diff)
downloadmongo-68392eb9672020b6e1e784450d75c098d243c7ef.tar.gz
SERVER-36132 Invariant that chunk migration is actually reflected in the metadata after successful commit
(cherry picked from commit 4858e05ee6bb59ec728d74802766c05b122aeced)
-rw-r--r--src/mongo/db/s/migration_source_manager.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/mongo/db/s/migration_source_manager.cpp b/src/mongo/db/s/migration_source_manager.cpp
index 035d21cbb82..28c43545e94 100644
--- a/src/mongo/db/s/migration_source_manager.cpp
+++ b/src/mongo/db/s/migration_source_manager.cpp
@@ -413,7 +413,21 @@ Status MigrationSourceManager::commitChunkMetadataOnConfig(OperationContext* txn
}
if (refreshedMetadata->keyBelongsToMe(_args.getMinKey())) {
- // The chunk modification was not applied, so report the original error
+ // 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.configOpTime();
+ severe() << "The commit response contained:";
+ severe() << " metadata: "
+ << redact(commitChunkMigrationResponse.getValue().metadata.toString());
+ severe() << " response: "
+ << redact(commitChunkMigrationResponse.getValue().response.toString());
+
+ fassertFailed(50878);
+ }
+
return {migrationCommitStatus.code(),
str::stream() << "Chunk move was not successful due to "
<< migrationCommitStatus.reason()};