diff options
author | Louis Williams <louis.williams@mongodb.com> | 2020-07-09 13:08:19 -0400 |
---|---|---|
committer | Louis Williams <louis.williams@mongodb.com> | 2020-07-17 15:13:09 -0400 |
commit | 97cd266f1b5df7f3af81d487e6dab2ca1060935a (patch) | |
tree | 60d7d484311cc8af9f5a630e0ecdc803930edebf | |
parent | 15cf23251bba4dc87d6171d24210bb7fd91eb614 (diff) | |
download | mongo-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.js | 8 |
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; }; |