summaryrefslogtreecommitdiff
path: root/jstests/hooks
diff options
context:
space:
mode:
authorA. Jesse Jiryu Davis <jesse@mongodb.com>2020-10-30 09:06:57 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-11-02 00:29:01 +0000
commit2c8c742c516cbca9a8724eda610d3b01b0b3d62c (patch)
tree421b67735d691164a0d1e8c39555239f4f5736c6 /jstests/hooks
parent3325b1274ddd373793d84d3877ad25042f9a01e8 (diff)
downloadmongo-2c8c742c516cbca9a8724eda610d3b01b0b3d62c.tar.gz
SERVER-51893 Ignore "can't connect to new replica set primary" in reconfig hook
Diffstat (limited to 'jstests/hooks')
-rw-r--r--jstests/hooks/run_reconfig_background.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/jstests/hooks/run_reconfig_background.js b/jstests/hooks/run_reconfig_background.js
index e6be7a7401c..44956183eb0 100644
--- a/jstests/hooks/run_reconfig_background.js
+++ b/jstests/hooks/run_reconfig_background.js
@@ -131,19 +131,24 @@ try {
// If the ReplicaSetMonitor cannot find a primary because it has stepped down or
// been killed, it may take longer than 15 seconds for a new primary to step up.
// Ignore this error until we find a new primary.
- const kReplicaSetMonitorError =
- /^Could not find host matching read preference.*mode: "primary"/;
+ const kReplicaSetMonitorErrors = [
+ /^Could not find host matching read preference.*mode: "primary"/,
+ /^can't connect to new replica set primary/
+ ];
if (isNetworkError(e)) {
jsTestLog("Ignoring network error" + tojson(e));
- } else if (e.message.match(kReplicaSetMonitorError)) {
- jsTestLog("Ignoring read preference primary error" + tojson(e));
+ } else if (kReplicaSetMonitorErrors.some((regex) => {
+ return regex.test(e.message);
+ })) {
+ jsTestLog("Ignoring replica set monitor error" + tojson(e));
} else if (e.code === ErrorCodes.ShutdownInProgress) {
// When a node is being shutdown, it is possible to fail isMaster requests with
// ShutdownInProgress. If we encounter this error, ignore it and find a new
// primary.
jsTestLog("Ignoring ShutdownInProgress error" + tojson(e));
} else {
+ jsTestLog(`run_reconfig_background unexpected error: ${tojson(e)}`);
throw e;
}