summaryrefslogtreecommitdiff
path: root/jstests/hooks
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2018-12-27 14:37:48 -0500
committerMax Hirschhorn <max.hirschhorn@mongodb.com>2018-12-27 14:37:48 -0500
commit1b5d91ae9641c4416ef6797cdeb757cb1a424eaf (patch)
tree5a4880d359887447695793e9863090c85554b7b8 /jstests/hooks
parent7b72db38ae0121b3df3ac2f5bcbe6ea446ead3cb (diff)
downloadmongo-1b5d91ae9641c4416ef6797cdeb757cb1a424eaf.tar.gz
SERVER-37143 Retry background dbHash check on Interrupted errors.
Diffstat (limited to 'jstests/hooks')
-rw-r--r--jstests/hooks/run_check_repl_dbhash_background.js15
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 5f4be783182..d3029ea27ba 100644
--- a/jstests/hooks/run_check_repl_dbhash_background.js
+++ b/jstests/hooks/run_check_repl_dbhash_background.js
@@ -241,8 +241,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;
}