diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2018-12-27 17:03:43 -0500 |
---|---|---|
committer | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2018-12-27 17:03:43 -0500 |
commit | a51152ce554147363948bca58fd167184eabba99 (patch) | |
tree | d676cbbd3d8c06ae02a69886be70fdf7feb6d797 | |
parent | 38c0f8331a2d3fc35d6a2e3bd46fbc93f28309fb (diff) | |
download | mongo-a51152ce554147363948bca58fd167184eabba99.tar.gz |
SERVER-37143 Retry background dbHash check on Interrupted errors.
(cherry picked from commit 1b5d91ae9641c4416ef6797cdeb757cb1a424eaf)
-rw-r--r-- | jstests/hooks/run_check_repl_dbhash_background.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/jstests/hooks/run_check_repl_dbhash_background.js b/jstests/hooks/run_check_repl_dbhash_background.js index 1a06e5700d0..83079541e8d 100644 --- a/jstests/hooks/run_check_repl_dbhash_background.js +++ b/jstests/hooks/run_check_repl_dbhash_background.js @@ -222,8 +222,19 @@ // The isTransientError() function is responsible for setting hasTransientError to true. const isTransientError = (e) => { - if (e.hasOwnProperty('errorLabels') && - e.errorLabels.includes('TransientTransactionError')) { + // It is possible for the ReplSetTest#getHashesUsingSessions() function to be + // interrupted due to active sessions being killed by a test running concurrently. We + // treat this as a transient error and simply retry running the dbHash check. + // + // Note that unlike auto_retry_transaction.js, we do not treat CursorKilled or + // CursorNotFound error responses as transient errors because the + // run_check_repl_dbhash_background.js hook would only establish a cursor via + // ReplSetTest#getCollectionDiffUsingSessions() upon detecting a dbHash mismatch. It is + // presumed to still useful to know that a bug exists even if we cannot get more + // diagnostics for it. + if ((e.hasOwnProperty('errorLabels') && + e.errorLabels.includes('TransientTransactionError')) || + e.code === ErrorCodes.Interrupted) { hasTransientError = true; return true; } |