summaryrefslogtreecommitdiff
path: root/src/mongo/shell/data_consistency_checker.js
diff options
context:
space:
mode:
authorJason Chan <jason.chan@mongodb.com>2022-02-09 15:45:19 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-02-09 16:44:28 +0000
commit107b1f9e81d5c523923c21f47cba54f174733b96 (patch)
treef5c1b3fb4140ff06fd4ed1f3c56aa6de9934577d /src/mongo/shell/data_consistency_checker.js
parent0865fcb3162a72495c4259b80893e9b74b1069ea (diff)
downloadmongo-107b1f9e81d5c523923c21f47cba54f174733b96.tar.gz
SERVER-63214 Ignore hash inconsistency between whole dbs when collection hash mismatch between image collections
Diffstat (limited to 'src/mongo/shell/data_consistency_checker.js')
-rw-r--r--src/mongo/shell/data_consistency_checker.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/shell/data_consistency_checker.js b/src/mongo/shell/data_consistency_checker.js
index 9530b12c416..3a1621b11de 100644
--- a/src/mongo/shell/data_consistency_checker.js
+++ b/src/mongo/shell/data_consistency_checker.js
@@ -321,6 +321,7 @@ var {DataConsistencyChecker} = (function() {
}
const nonCappedCollNames = sourceCollInfos.getNonCappedCollNames();
+ let didIgnoreFailure = false;
// Only compare the dbhashes of non-capped collections because capped
// collections are not necessarily truncated at the same points between the source and
// syncing nodes.
@@ -342,6 +343,7 @@ var {DataConsistencyChecker} = (function() {
restart scenarios.`);
}
success = shouldIgnoreFailure && success;
+ didIgnoreFailure = shouldIgnoreFailure || didIgnoreFailure;
}
});
@@ -473,6 +475,14 @@ var {DataConsistencyChecker} = (function() {
if (sourceDBHash.md5 !== syncingDBHash.md5) {
prettyPrint(`the two nodes have a different hash for the ${dbName} database: ${
dbHashesMsg}`);
+ if (didIgnoreFailure) {
+ // We only expect database hash mismatches on the config db, where
+ // config.image_collection is expected to have inconsistencies in certain
+ // scenarios.
+ prettyPrint(`Ignoring hash mismatch for the ${dbName} database since
+ inconsistencies in 'config.image_collection' can be expected`);
+ return success;
+ }
success = false;
}
}