diff options
Diffstat (limited to 'jstests/sharding/awaitable_hello_primary_failures.js')
| -rw-r--r-- | jstests/sharding/awaitable_hello_primary_failures.js | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/jstests/sharding/awaitable_hello_primary_failures.js b/jstests/sharding/awaitable_hello_primary_failures.js index b6a387920c3..1522f755347 100644 --- a/jstests/sharding/awaitable_hello_primary_failures.js +++ b/jstests/sharding/awaitable_hello_primary_failures.js @@ -22,9 +22,9 @@ let rsPrimary = st.rs0.getPrimary(); // Make sure mongos knows who the primary is awaitRSClientHosts(mongos, {host: rsPrimary.name}, {ok: true, ismaster: true}); -// Turn on the waitInHello failpoint. This will cause the primary node to cease sending isMaster +// Turn on the waitInHello failpoint. This will cause the primary node to cease sending "hello" // responses and the RSM should mark the node as down -jsTestLog("Turning on waitInHello failpoint. Node should stop sending isMaster responses."); +jsTestLog("Turning on waitInHello failpoint. Node should stop sending hello responses."); const helloFailpoint = configureFailPoint(rsPrimary, "waitInHello"); awaitRSClientHosts(mongos, {host: rsPrimary.name}, {ok: false, ismaster: false}); helloFailpoint.off(); @@ -32,25 +32,26 @@ helloFailpoint.off(); // Wait for mongos to find out the node is still primary awaitRSClientHosts(mongos, {host: rsPrimary.name}, {ok: true, ismaster: true}); -// Force the primary node to fail all isMaster requests. The RSM should mark the node as down. -jsTestLog("Turning on failCommand failpoint. Node should fail all isMaster responses."); -const failCmdFailpoint = configureFailPoint( - rsPrimary, - "failCommand", - {errorCode: ErrorCodes.CommandFailed, failCommands: ["isMaster"], failInternalCommands: true}); +// Force the primary node to fail all "hello" requests. The RSM should mark the node as down. +jsTestLog("Turning on failCommand failpoint. Node should fail all hello/isMaster responses."); +const failCmdFailpoint = configureFailPoint(rsPrimary, "failCommand", { + errorCode: ErrorCodes.CommandFailed, + failCommands: ["hello", "isMaster"], + failInternalCommands: true +}); awaitRSClientHosts(mongos, {host: rsPrimary.name}, {ok: false, ismaster: false}); failCmdFailpoint.off(); // Wait for mongos to find out the node is still primary awaitRSClientHosts(mongos, {host: rsPrimary.name}, {ok: true, ismaster: true}); -// Force the primary node to end the isMaster stream by not setting the 'moreToCome' bit on the +// Force the primary node to end the "hello" stream by not setting the 'moreToCome' bit on the // resposne. The RSM should not mark the server as down or unknown and should continue monitoring // the node. jsTestLog( - "Turning on doNotSetMoreToCome failpoint. Node should return successful isMaster responses."); + "Turning on doNotSetMoreToCome failpoint. Node should return successful hello responses."); const moreToComeFailpoint = configureFailPoint(rsPrimary, "doNotSetMoreToCome"); -// Wait for maxAwaitTimeMS to guarantee that mongos has received at least one isMaster response from +// Wait for maxAwaitTimeMS to guarantee that mongos has received at least one "hello" response from // the primary without the moreToCome bit set. sleep(10000); awaitRSClientHosts(mongos, {host: rsPrimary.name}, {ok: true, ismaster: true}); |
