summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2020-07-09 13:08:19 -0400
committerLouis Williams <louis.williams@mongodb.com>2020-07-17 15:13:09 -0400
commit97cd266f1b5df7f3af81d487e6dab2ca1060935a (patch)
tree60d7d484311cc8af9f5a630e0ecdc803930edebf
parent15cf23251bba4dc87d6171d24210bb7fd91eb614 (diff)
downloadmongo-97cd266f1b5df7f3af81d487e6dab2ca1060935a.tar.gz
SERVER-43060 CheckReplDBHashInBackground should retry the dbHash command on WriteConflicts in debug builds
(cherry picked from commit ab4d803f1f2f57cf9dbec89175f8eb52cb4761f2)
-rw-r--r--jstests/hooks/run_check_repl_dbhash_background.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/jstests/hooks/run_check_repl_dbhash_background.js b/jstests/hooks/run_check_repl_dbhash_background.js
index 66a85c43c36..1a61b3c2785 100644
--- a/jstests/hooks/run_check_repl_dbhash_background.js
+++ b/jstests/hooks/run_check_repl_dbhash_background.js
@@ -309,6 +309,14 @@ function checkReplDbhashBackgroundThread(hosts) {
hasTransientError = true;
}
+ // In debug builds, read-only operations can receive write conflicts when the storage
+ // engine cache is full. Since dbHash holds open a read snapshot for an extended period
+ // of time and pulls all collection data into cache, the storage engine may abort the
+ // operation if it needs to free up space. Try again after space has been freed.
+ if (e.code === ErrorCodes.WriteConflict && buildInfo().debug) {
+ hasTransientError = true;
+ }
+
return hasTransientError;
};