summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Ahmad <josef.ahmad@mongodb.com>2022-01-20 14:12:46 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-21 08:48:51 +0000
commit7c13a4891595fe670ff580d7275fff51ac0c8d86 (patch)
treec2ef0fe87371d5d87ad7df256341a27d2cd480a1
parent409e00d09bbc3d77f6a2fd32c0af8380300e1668 (diff)
downloadmongo-7c13a4891595fe670ff580d7275fff51ac0c8d86.tar.gz
SERVER-62336 Tolerate SnapshotTooOld errors in dbCheck testing
(cherry picked from commit ee111876a65ca5f5fdb70c3a0e26eeb57ca79cdd)
-rw-r--r--jstests/hooks/run_dbcheck_background.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/jstests/hooks/run_dbcheck_background.js b/jstests/hooks/run_dbcheck_background.js
index 4abfb414f7c..23ae5e5bd83 100644
--- a/jstests/hooks/run_dbcheck_background.js
+++ b/jstests/hooks/run_dbcheck_background.js
@@ -95,9 +95,14 @@ function runBackgroundDbCheck(hosts) {
})
];
nodes.forEach((node) => {
- // Assert no errors (i.e., found inconsistencies). Allow warnings.
+ // Assert no errors (i.e., found inconsistencies). Allow warnings. Tolerate SnapshotTooOld
+ // errors, as they can occur if the primary is slow enough processing a batch that the
+ // secondary is unable to obtain the timestamp the primary used.
const healthlog = node.getDB('local').system.healthlog;
- let errs = healthlog.find({"severity": "error"});
+ // Regex matching strings that start without "SnapshotTooOld"
+ const regexStringWithoutSnapTooOld = /^((?!^SnapshotTooOld).)*$/;
+ let errs =
+ healthlog.find({"severity": "error", "data.error": regexStringWithoutSnapTooOld});
if (errs.hasNext()) {
const err = "dbCheck found inconsistency on " + node.host;
jsTestLog(err + ". Errors: ");