summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavi Vetriselvan <pavithra.vetriselvan@mongodb.com>2020-10-06 09:49:03 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-11-02 21:23:08 +0000
commit4f0ff74a73b16db750e93cc2e21fb068c46c4baf (patch)
tree20d4e5cda80bf8d5bdacb8fbb1cfb4c06da76e62
parent0ebf1889c945303ad54b9ac41e7b2004d37590eb (diff)
downloadmongo-4f0ff74a73b16db750e93cc2e21fb068c46c4baf.tar.gz
SERVER-51259 Rename waitForIsMasterResponse failpoint to waitForHelloResponse
(cherry picked from commit f25cd7c223715155d05ec1a44c2212f8a70dea40)
-rw-r--r--jstests/replsets/awaitable_ismaster_errors_on_horizon_change.js8
-rw-r--r--jstests/replsets/awaitable_ismaster_fcv_change.js8
-rw-r--r--jstests/replsets/awaitable_ismaster_metrics_on_state_change.js4
-rw-r--r--jstests/replsets/awaitable_ismaster_on_nodes_with_invalid_configs.js16
-rw-r--r--jstests/replsets/awaitable_ismaster_stepdown_stepup.js6
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.cpp8
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl_test.cpp96
7 files changed, 73 insertions, 73 deletions
diff --git a/jstests/replsets/awaitable_ismaster_errors_on_horizon_change.js b/jstests/replsets/awaitable_ismaster_errors_on_horizon_change.js
index a595f512618..59ee117d475 100644
--- a/jstests/replsets/awaitable_ismaster_errors_on_horizon_change.js
+++ b/jstests/replsets/awaitable_ismaster_errors_on_horizon_change.js
@@ -50,8 +50,8 @@ const secondaryTopologyVersion = secondaryFirstResponse.topologyVersion;
// A failpoint signalling that the server has received the isMaster request and is waiting for a
// topology change.
-let primaryFailPoint = configureFailPoint(primary, "waitForIsMasterResponse");
-let secondaryFailPoint = configureFailPoint(secondary, "waitForIsMasterResponse");
+let primaryFailPoint = configureFailPoint(primary, "waitForHelloResponse");
+let secondaryFailPoint = configureFailPoint(secondary, "waitForHelloResponse");
// Send an awaitable isMaster request. This will block until there is a topology change.
const awaitIsMasterHorizonChangeOnPrimary = startParallelShell(
funWithArgs(runAwaitableIsMasterBeforeHorizonChange, primaryTopologyVersion), primary.port);
@@ -107,8 +107,8 @@ rsConfig.members.forEach(function(member) {
rsConfig.version++;
// Reconfigure the failpoint to refresh the number of times the failpoint has been entered.
-primaryFailPoint = configureFailPoint(primary, "waitForIsMasterResponse");
-secondaryFailPoint = configureFailPoint(primary, "waitForIsMasterResponse");
+primaryFailPoint = configureFailPoint(primary, "waitForHelloResponse");
+secondaryFailPoint = configureFailPoint(primary, "waitForHelloResponse");
// Send an awaitable isMaster request. This will block until maxAwaitTimeMS has elapsed or a
// topology change happens.
let primaryAwaitIsMasterBeforeAddingTags = startParallelShell(
diff --git a/jstests/replsets/awaitable_ismaster_fcv_change.js b/jstests/replsets/awaitable_ismaster_fcv_change.js
index 96897fee307..cb3aa2a1e84 100644
--- a/jstests/replsets/awaitable_ismaster_fcv_change.js
+++ b/jstests/replsets/awaitable_ismaster_fcv_change.js
@@ -89,8 +89,8 @@ function runAwaitableIsMasterBeforeFCVChange(
// A failpoint signalling that the servers have received the isMaster request and are waiting for a
// topology change.
-let primaryFailPoint = configureFailPoint(primary, "waitForIsMasterResponse");
-let secondaryFailPoint = configureFailPoint(secondary, "waitForIsMasterResponse");
+let primaryFailPoint = configureFailPoint(primary, "waitForHelloResponse");
+let secondaryFailPoint = configureFailPoint(secondary, "waitForHelloResponse");
// Send an awaitable isMaster request. This will block until maxAwaitTimeMS has elapsed or a
// topology change happens.
@@ -171,8 +171,8 @@ assert(secondaryResponseAfterDowngrade.hasOwnProperty("topologyVersion"),
const secondaryTopologyVersionAfterDowngrade = secondaryResponseAfterDowngrade.topologyVersion;
// Reconfigure the failpoint to refresh the number of times the failpoint has been entered.
-primaryFailPoint = configureFailPoint(primary, "waitForIsMasterResponse");
-secondaryFailPoint = configureFailPoint(secondary, "waitForIsMasterResponse");
+primaryFailPoint = configureFailPoint(primary, "waitForHelloResponse");
+secondaryFailPoint = configureFailPoint(secondary, "waitForHelloResponse");
let awaitIsMasterBeforeUpgradeFCVOnPrimary =
startParallelShell(funWithArgs(runAwaitableIsMasterBeforeFCVChange,
primaryTopologyVersionAfterDowngrade,
diff --git a/jstests/replsets/awaitable_ismaster_metrics_on_state_change.js b/jstests/replsets/awaitable_ismaster_metrics_on_state_change.js
index afcb3c72a53..dd07ed1da49 100644
--- a/jstests/replsets/awaitable_ismaster_metrics_on_state_change.js
+++ b/jstests/replsets/awaitable_ismaster_metrics_on_state_change.js
@@ -35,7 +35,7 @@ function runAwaitableIsMaster(topologyVersionField) {
// A failpoint signalling that the server has received the IsMaster request and is waiting for a
// topology change.
-let failPoint = configureFailPoint(node, "waitForIsMasterResponse");
+let failPoint = configureFailPoint(node, "waitForHelloResponse");
// Send an awaitable isMaster request. This will block until maxAwaitTimeMS has elapsed or a
// topology change happens.
let firstIsMasterBeforeStepDown =
@@ -46,7 +46,7 @@ let numAwaitingTopologyChange = db.serverStatus().connections.awaitingTopologyCh
assert.eq(1, numAwaitingTopologyChange);
// Reconfigure failpoint to refresh the number of times entered.
-failPoint = configureFailPoint(node, "waitForIsMasterResponse");
+failPoint = configureFailPoint(node, "waitForHelloResponse");
let secondIsMasterBeforeStepdown =
startParallelShell(funWithArgs(runAwaitableIsMaster, topologyVersionField), node.port);
failPoint.wait();
diff --git a/jstests/replsets/awaitable_ismaster_on_nodes_with_invalid_configs.js b/jstests/replsets/awaitable_ismaster_on_nodes_with_invalid_configs.js
index 8106703f571..57552336f2d 100644
--- a/jstests/replsets/awaitable_ismaster_on_nodes_with_invalid_configs.js
+++ b/jstests/replsets/awaitable_ismaster_on_nodes_with_invalid_configs.js
@@ -49,8 +49,8 @@ function runAwaitableIsMasterOnRejoiningSet(topologyVersionField) {
// A failpoint signalling that the servers have received the isMaster request and are waiting for a
// topology change.
-let node0FailPoint = configureFailPoint(node0, "waitForIsMasterResponse");
-let node1FailPoint = configureFailPoint(node1, "waitForIsMasterResponse");
+let node0FailPoint = configureFailPoint(node0, "waitForHelloResponse");
+let node1FailPoint = configureFailPoint(node1, "waitForHelloResponse");
// Send an awaitable isMaster request. This will block until there is a topology change.
const firstAwaitInitiateOnNode0 =
startParallelShell(funWithArgs(runAwaitableIsMaster, topologyVersionNode0), node0.port);
@@ -66,8 +66,8 @@ assert.eq(1, numAwaitingTopologyChangeOnNode0);
assert.eq(1, numAwaitingTopologyChangeOnNode1);
// Reconfigure the failpoint to refresh the number of times the failpoint has been entered.
-node0FailPoint = configureFailPoint(node0, "waitForIsMasterResponse");
-node1FailPoint = configureFailPoint(node1, "waitForIsMasterResponse");
+node0FailPoint = configureFailPoint(node0, "waitForHelloResponse");
+node1FailPoint = configureFailPoint(node1, "waitForHelloResponse");
const secondAwaitInitiateOnNode0 =
startParallelShell(funWithArgs(runAwaitableIsMaster, topologyVersionNode0), node0.port);
const secondAwaitInitiateOnNode1 =
@@ -101,7 +101,7 @@ const primaryRespAfterInitiate = assert.commandWorked(primaryDB.runCommand({isMa
let primaryTopologyVersion = primaryRespAfterInitiate.topologyVersion;
// Reconfigure the failpoint to refresh the number of times the failpoint has been entered.
-let primaryFailPoint = configureFailPoint(primary, "waitForIsMasterResponse");
+let primaryFailPoint = configureFailPoint(primary, "waitForHelloResponse");
const awaitPrimaryIsMasterBeforeNodeRemoval =
startParallelShell(funWithArgs(runAwaitableIsMaster, primaryTopologyVersion), primary.port);
primaryFailPoint.wait();
@@ -134,8 +134,8 @@ assert.eq("Does not have a valid replica set config",
secondaryRespAfterRemoval);
// Reconfigure the failpoint to refresh the number of times the failpoint has been entered.
-primaryFailPoint = configureFailPoint(primary, "waitForIsMasterResponse");
-let secondaryFailPoint = configureFailPoint(secondary, "waitForIsMasterResponse");
+primaryFailPoint = configureFailPoint(primary, "waitForHelloResponse");
+let secondaryFailPoint = configureFailPoint(secondary, "waitForHelloResponse");
const awaitPrimaryIsMasterBeforeReadding =
startParallelShell(funWithArgs(runAwaitableIsMaster, primaryTopologyVersion), primary.port);
const firstAwaitSecondaryIsMasterBeforeRejoining = startParallelShell(
@@ -150,7 +150,7 @@ assert.eq(1, numAwaitingTopologyChangeOnPrimary);
assert.eq(1, numAwaitingTopologyChangeOnSecondary);
// Send a second isMaster to the removed secondary.
-secondaryFailPoint = configureFailPoint(secondary, "waitForIsMasterResponse");
+secondaryFailPoint = configureFailPoint(secondary, "waitForHelloResponse");
const secondAwaitSecondaryIsMasterBeforeRejoining = startParallelShell(
funWithArgs(runAwaitableIsMasterOnRejoiningSet, secondaryTopologyVersion), secondary.port);
secondaryFailPoint.wait();
diff --git a/jstests/replsets/awaitable_ismaster_stepdown_stepup.js b/jstests/replsets/awaitable_ismaster_stepdown_stepup.js
index 22235617344..d5c462cd913 100644
--- a/jstests/replsets/awaitable_ismaster_stepdown_stepup.js
+++ b/jstests/replsets/awaitable_ismaster_stepdown_stepup.js
@@ -98,7 +98,7 @@ function runAwaitableIsMasterAfterStepUp(topologyVersionField) {
// A failpoint signalling that the server has received the IsMaster request and is waiting for a
// topology change.
-let failPoint = configureFailPoint(node, "waitForIsMasterResponse");
+let failPoint = configureFailPoint(node, "waitForHelloResponse");
// Send an awaitable isMaster request. This will block until maxAwaitTimeMS has elapsed or a
// topology change happens.
let awaitIsMasterBeforeStepDown = startParallelShell(
@@ -116,7 +116,7 @@ assert(response.hasOwnProperty("topologyVersion"), tojson(res));
const topologyVersionAfterStepDown = response.topologyVersion;
// Reconfigure the failpoint to refresh the number of times the failpoint has been entered.
-failPoint = configureFailPoint(node, "waitForIsMasterResponse");
+failPoint = configureFailPoint(node, "waitForHelloResponse");
const hangFailPoint = configureFailPoint(node, "hangAfterReconfigOnDrainComplete");
// Send an awaitable isMaster request. This will block until maxAwaitTimeMS has elapsed or a
// topology change happens.
@@ -136,7 +136,7 @@ assert(response.hasOwnProperty("topologyVersion"), tojson(res));
const topologyVersionAfterStepUp = response.topologyVersion;
// Reconfigure the failpoint to refresh the number of times the failpoint has been entered.
-failPoint = configureFailPoint(node, "waitForIsMasterResponse");
+failPoint = configureFailPoint(node, "waitForHelloResponse");
// Send an awaitable isMaster request. This will block until maxAwaitTimeMS has elapsed or a
// topology change happens.
let awaitIsMasterAfterStepUp = startParallelShell(
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp
index 0c804140281..ef4eed682ee 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl.cpp
@@ -118,8 +118,8 @@ MONGO_FAIL_POINT_DEFINE(stepdownHangBeforeRSTLEnqueue);
// Fail setMaintenanceMode with ErrorCodes::NotSecondary to simulate a concurrent election.
MONGO_FAIL_POINT_DEFINE(setMaintenanceModeFailsWithNotSecondary);
MONGO_FAIL_POINT_DEFINE(forceSyncSourceRetryWaitForInitialSync);
-// Signals that an isMaster request has started waiting.
-MONGO_FAIL_POINT_DEFINE(waitForIsMasterResponse);
+// Signals that a hello request has started waiting.
+MONGO_FAIL_POINT_DEFINE(waitForHelloResponse);
// Will cause a hello request to hang as it starts waiting.
MONGO_FAIL_POINT_DEFINE(hangWhileWaitingForHelloResponse);
MONGO_FAIL_POINT_DEFINE(skipDurableTimestampUpdates);
@@ -2191,10 +2191,10 @@ std::shared_ptr<const IsMasterResponse> ReplicationCoordinatorImpl::awaitIsMaste
IsMasterMetrics::get(opCtx)->incrementNumAwaitingTopologyChanges();
lk.unlock();
- if (MONGO_unlikely(waitForIsMasterResponse.shouldFail())) {
+ if (MONGO_unlikely(waitForHelloResponse.shouldFail())) {
// Used in tests that wait for this failpoint to be entered before triggering a topology
// change.
- LOGV2(31464, "waitForIsMasterResponse failpoint enabled");
+ LOGV2(31464, "waitForHelloResponse failpoint enabled");
}
if (MONGO_unlikely(hangWhileWaitingForHelloResponse.shouldFail())) {
LOGV2(21341, "Hanging due to hangWhileWaitingForHelloResponse failpoint");
diff --git a/src/mongo/db/repl/replication_coordinator_impl_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_test.cpp
index f5fcc4d9988..dc97a5c6687 100644
--- a/src/mongo/db/repl/replication_coordinator_impl_test.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl_test.cpp
@@ -3184,9 +3184,9 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsOnStepDown) {
auto opCtx = makeOperationContext();
- auto waitForIsMasterFailPoint = globalFailPointRegistry().find("waitForIsMasterResponse");
- auto timesEnteredFailPoint = waitForIsMasterFailPoint->setMode(FailPoint::alwaysOn, 0);
- ON_BLOCK_EXIT([&] { waitForIsMasterFailPoint->setMode(FailPoint::off, 0); });
+ auto waitForHelloFailPoint = globalFailPointRegistry().find("waitForHelloResponse");
+ auto timesEnteredFailPoint = waitForHelloFailPoint->setMode(FailPoint::alwaysOn, 0);
+ ON_BLOCK_EXIT([&] { waitForHelloFailPoint->setMode(FailPoint::off, 0); });
// awaitIsMasterResponse blocks and waits on a future when the request TopologyVersion equals
// the current TopologyVersion of the server.
@@ -3226,7 +3226,7 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsOnStepDown) {
});
// Ensure that awaitIsMasterResponse() is called before triggering a stepdown.
- waitForIsMasterFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
+ waitForHelloFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
// A topology change should cause the server to respond to the waiting IsMasterResponse.
getReplCoord()->stepDown(opCtx.get(), true, Milliseconds(0), Milliseconds(1000));
ASSERT_TRUE(getTopoCoord().getMemberState().secondary());
@@ -3327,9 +3327,9 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsErrorOnHorizonChange) {
auto deadline = getNet()->now() + maxAwaitTime;
auto opCtx = makeOperationContext();
- auto waitForIsMasterFailPoint = globalFailPointRegistry().find("waitForIsMasterResponse");
- auto timesEnteredFailPoint = waitForIsMasterFailPoint->setMode(FailPoint::alwaysOn, 0);
- ON_BLOCK_EXIT([&] { waitForIsMasterFailPoint->setMode(FailPoint::off, 0); });
+ auto waitForHelloFailPoint = globalFailPointRegistry().find("waitForHelloResponse");
+ auto timesEnteredFailPoint = waitForHelloFailPoint->setMode(FailPoint::alwaysOn, 0);
+ ON_BLOCK_EXIT([&] { waitForHelloFailPoint->setMode(FailPoint::off, 0); });
// awaitIsMasterResponse blocks and waits on a future when the request TopologyVersion equals
// the current TopologyVersion of the server.
@@ -3343,7 +3343,7 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsErrorOnHorizonChange) {
});
// Ensure that the isMaster request is waiting before doing a reconfig.
- waitForIsMasterFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
+ waitForHelloFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
BSONObjBuilder garbage;
ReplSetReconfigArgs args;
// Use force to bypass the oplog commitment check, which we're not worried about testing here.
@@ -3389,7 +3389,7 @@ TEST_F(ReplCoordTest, NonAwaitableIsMasterReturnsNoConfigsOnNodeWithUninitialize
ASSERT_FALSE(response->isConfigSet());
}
-TEST_F(ReplCoordTest, AwaitableIsMasterOnNodeWithUninitializedConfig) {
+TEST_F(ReplCoordTest, AwaitableHelloOnNodeWithUninitializedConfig) {
init("mySet");
start(HostAndPort("node1", 12345));
auto opCtx = makeOperationContext();
@@ -3424,9 +3424,9 @@ TEST_F(ReplCoordTest, AwaitableIsMasterOnNodeWithUninitializedConfig) {
ASSERT_TRUE(isMasterReturned);
getNet()->exitNetwork();
- auto waitForIsMasterFailPoint = globalFailPointRegistry().find("waitForIsMasterResponse");
- auto timesEnteredFailPoint = waitForIsMasterFailPoint->setMode(FailPoint::alwaysOn, 0);
- ON_BLOCK_EXIT([&] { waitForIsMasterFailPoint->setMode(FailPoint::off, 0); });
+ auto waitForHelloFailPoint = globalFailPointRegistry().find("waitForHelloResponse");
+ auto timesEnteredFailPoint = waitForHelloFailPoint->setMode(FailPoint::alwaysOn, 0);
+ ON_BLOCK_EXIT([&] { waitForHelloFailPoint->setMode(FailPoint::off, 0); });
deadline = getNet()->now() + maxAwaitTime;
stdx::thread awaitIsMasterInitiate([&] {
@@ -3442,7 +3442,7 @@ TEST_F(ReplCoordTest, AwaitableIsMasterOnNodeWithUninitializedConfig) {
});
// Ensure that awaitIsMasterResponse() is called before initiating.
- waitForIsMasterFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
+ waitForHelloFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
BSONObjBuilder result;
auto status =
@@ -3534,9 +3534,9 @@ TEST_F(ReplCoordTest, AwaitableIsMasterOnNodeWithUninitializedConfigInvalidHoriz
ASSERT_FALSE(initialResponse->isSecondary());
ASSERT_FALSE(initialResponse->isConfigSet());
- auto waitForIsMasterFailPoint = globalFailPointRegistry().find("waitForIsMasterResponse");
- auto timesEnteredFailPoint = waitForIsMasterFailPoint->setMode(FailPoint::alwaysOn, 0);
- ON_BLOCK_EXIT([&] { waitForIsMasterFailPoint->setMode(FailPoint::off, 0); });
+ auto waitForHelloFailPoint = globalFailPointRegistry().find("waitForHelloResponse");
+ auto timesEnteredFailPoint = waitForHelloFailPoint->setMode(FailPoint::alwaysOn, 0);
+ ON_BLOCK_EXIT([&] { waitForHelloFailPoint->setMode(FailPoint::off, 0); });
stdx::thread awaitIsMasterInitiate([&] {
const auto topologyVersion = getTopoCoord().getTopologyVersion();
@@ -3547,7 +3547,7 @@ TEST_F(ReplCoordTest, AwaitableIsMasterOnNodeWithUninitializedConfigInvalidHoriz
});
// Ensure that the isMaster request has started waiting before initiating.
- waitForIsMasterFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
+ waitForHelloFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
// Call replSetInitiate with no horizon configured. This should return an error to the isMaster
// request that is currently waiting on a horizonParam that doesn't exit in the config.
@@ -3575,9 +3575,9 @@ TEST_F(ReplCoordTest, AwaitableIsMasterOnNodeWithUninitializedConfigSpecifiedHor
const std::string horizonSniName = "horizon.com";
const auto horizonParam = SplitHorizon::Parameters(horizonSniName);
- auto waitForIsMasterFailPoint = globalFailPointRegistry().find("waitForIsMasterResponse");
- auto timesEnteredFailPoint = waitForIsMasterFailPoint->setMode(FailPoint::alwaysOn, 0);
- ON_BLOCK_EXIT([&] { waitForIsMasterFailPoint->setMode(FailPoint::off, 0); });
+ auto waitForHelloFailPoint = globalFailPointRegistry().find("waitForHelloResponse");
+ auto timesEnteredFailPoint = waitForHelloFailPoint->setMode(FailPoint::alwaysOn, 0);
+ ON_BLOCK_EXIT([&] { waitForHelloFailPoint->setMode(FailPoint::off, 0); });
const std::string horizonOneSniName = "horizon1.com";
const auto horizonOne = SplitHorizon::Parameters(horizonOneSniName);
@@ -3596,7 +3596,7 @@ TEST_F(ReplCoordTest, AwaitableIsMasterOnNodeWithUninitializedConfigSpecifiedHor
ASSERT_TRUE(response->isConfigSet());
});
- waitForIsMasterFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
+ waitForHelloFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
// Call replSetInitiate with a horizon configured.
BSONObjBuilder result;
@@ -3964,9 +3964,9 @@ TEST_F(ReplCoordTest, AwaitIsMasterRespondsCorrectlyWhenNodeRemovedAndReadded) {
auto deadline = net->now() + maxAwaitTime;
auto opCtx = makeOperationContext();
- auto waitForIsMasterFailPoint = globalFailPointRegistry().find("waitForIsMasterResponse");
- auto timesEnteredFailPoint = waitForIsMasterFailPoint->setMode(FailPoint::alwaysOn, 0);
- ON_BLOCK_EXIT([&] { waitForIsMasterFailPoint->setMode(FailPoint::off, 0); });
+ auto waitForHelloFailPoint = globalFailPointRegistry().find("waitForHelloResponse");
+ auto timesEnteredFailPoint = waitForHelloFailPoint->setMode(FailPoint::alwaysOn, 0);
+ ON_BLOCK_EXIT([&] { waitForHelloFailPoint->setMode(FailPoint::off, 0); });
stdx::thread getIsMasterWaitingForRemovedNodeThread([&] {
const auto topologyVersion = getTopoCoord().getTopologyVersion();
@@ -3983,7 +3983,7 @@ TEST_F(ReplCoordTest, AwaitIsMasterRespondsCorrectlyWhenNodeRemovedAndReadded) {
});
// Ensure that awaitIsMasterResponse() is called before triggering a reconfig.
- waitForIsMasterFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
+ waitForHelloFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
enterNetwork();
ASSERT_TRUE(net->hasReadyRequests());
@@ -4028,7 +4028,7 @@ TEST_F(ReplCoordTest, AwaitIsMasterRespondsCorrectlyWhenNodeRemovedAndReadded) {
AssertionException,
ErrorCodes::SplitHorizonChange);
});
- waitForIsMasterFailPoint->waitForTimesEntered(timesEnteredFailPoint + 2);
+ waitForHelloFailPoint->waitForTimesEntered(timesEnteredFailPoint + 2);
const auto newHorizonNodeOne = "newhorizon.com:100";
const auto newHorizonNodeTwo = "newhorizon.com:200";
@@ -4111,9 +4111,9 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsOnElectionTimeout) {
auto expectedCounter = currentTopologyVersion.getCounter() + 1;
auto opCtx = makeOperationContext();
- auto waitForIsMasterFailPoint = globalFailPointRegistry().find("waitForIsMasterResponse");
- auto timesEnteredFailPoint = waitForIsMasterFailPoint->setMode(FailPoint::alwaysOn, 0);
- ON_BLOCK_EXIT([&] { waitForIsMasterFailPoint->setMode(FailPoint::off, 0); });
+ auto waitForHelloFailPoint = globalFailPointRegistry().find("waitForHelloResponse");
+ auto timesEnteredFailPoint = waitForHelloFailPoint->setMode(FailPoint::alwaysOn, 0);
+ ON_BLOCK_EXIT([&] { waitForHelloFailPoint->setMode(FailPoint::off, 0); });
// awaitIsMasterResponse blocks and waits on a future when the request TopologyVersion equals
// the current TopologyVersion of the server.
@@ -4130,7 +4130,7 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsOnElectionTimeout) {
});
// Ensure that awaitIsMasterResponse() is called before triggering an election timeout.
- waitForIsMasterFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
+ waitForHelloFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
getNet()->enterNetwork();
// Primary steps down after not receiving a response within the election timeout.
getNet()->advanceTime(electionTimeoutDate);
@@ -4176,9 +4176,9 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsOnElectionWin) {
ASSERT_TRUE(response->isSecondary());
ASSERT_FALSE(response->hasPrimary());
- auto waitForIsMasterFailPoint = globalFailPointRegistry().find("waitForIsMasterResponse");
- auto timesEnteredFailPoint = waitForIsMasterFailPoint->setMode(FailPoint::alwaysOn, 0);
- ON_BLOCK_EXIT([&] { waitForIsMasterFailPoint->setMode(FailPoint::off, 0); });
+ auto waitForHelloFailPoint = globalFailPointRegistry().find("waitForHelloResponse");
+ auto timesEnteredFailPoint = waitForHelloFailPoint->setMode(FailPoint::alwaysOn, 0);
+ ON_BLOCK_EXIT([&] { waitForHelloFailPoint->setMode(FailPoint::off, 0); });
// awaitIsMasterResponse blocks and waits on a future when the request TopologyVersion equals
// the current TopologyVersion of the server.
@@ -4215,7 +4215,7 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsOnElectionWin) {
});
// Ensure that awaitIsMasterResponse() is called before finishing the election.
- waitForIsMasterFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
+ waitForHelloFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
auto electionTimeoutWhen = getReplCoord()->getElectionTimeout_forTest();
ASSERT_NOT_EQUALS(Date_t(), electionTimeoutWhen);
LOGV2(21505,
@@ -4223,7 +4223,7 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsOnElectionWin) {
"electionTimeoutWhen"_attr = electionTimeoutWhen);
simulateSuccessfulV1ElectionWithoutExitingDrainMode(electionTimeoutWhen, opCtx.get());
- waitForIsMasterFailPoint->waitForTimesEntered(timesEnteredFailPoint + 2);
+ waitForHelloFailPoint->waitForTimesEntered(timesEnteredFailPoint + 2);
signalDrainComplete(opCtx.get());
ASSERT(getReplCoord()->getApplierState() == ReplicationCoordinator::ApplierState::Stopped);
@@ -4267,12 +4267,12 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsOnElectionWinWithReconfig) {
ASSERT_TRUE(response->isSecondary());
ASSERT_FALSE(response->hasPrimary());
- auto waitForIsMasterFailPoint = globalFailPointRegistry().find("waitForIsMasterResponse");
+ auto waitForHelloFailPoint = globalFailPointRegistry().find("waitForHelloResponse");
auto hangAfterReconfigFailPoint =
globalFailPointRegistry().find("hangAfterReconfigOnDrainComplete");
- auto timesEnteredFailPoint = waitForIsMasterFailPoint->setMode(FailPoint::alwaysOn);
- ON_BLOCK_EXIT([&] { waitForIsMasterFailPoint->setMode(FailPoint::off, 0); });
+ auto timesEnteredFailPoint = waitForHelloFailPoint->setMode(FailPoint::alwaysOn);
+ ON_BLOCK_EXIT([&] { waitForHelloFailPoint->setMode(FailPoint::off, 0); });
// awaitIsMasterResponse blocks and waits on a future when the request TopologyVersion equals
// the current TopologyVersion of the server.
@@ -4324,7 +4324,7 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsOnElectionWinWithReconfig) {
});
// Ensure that awaitIsMasterResponse() is called before finishing the election.
- waitForIsMasterFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
+ waitForHelloFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
auto electionTimeoutWhen = getReplCoord()->getElectionTimeout_forTest();
ASSERT_NOT_EQUALS(Date_t(), electionTimeoutWhen);
LOGV2(4508104,
@@ -4332,7 +4332,7 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsOnElectionWinWithReconfig) {
"electionTimeoutWhen"_attr = electionTimeoutWhen);
simulateSuccessfulV1ElectionWithoutExitingDrainMode(electionTimeoutWhen, opCtx.get());
- waitForIsMasterFailPoint->waitForTimesEntered(timesEnteredFailPoint + 2);
+ waitForHelloFailPoint->waitForTimesEntered(timesEnteredFailPoint + 2);
signalDrainComplete(opCtx.get());
ASSERT(getReplCoord()->getApplierState() == ReplicationCoordinator::ApplierState::Stopped);
@@ -4759,9 +4759,9 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsOnReplSetReconfig) {
auto expectedCounter = currentTopologyVersion.getCounter() + 1;
auto opCtx = makeOperationContext();
- auto waitForIsMasterFailPoint = globalFailPointRegistry().find("waitForIsMasterResponse");
- auto timesEnteredFailPoint = waitForIsMasterFailPoint->setMode(FailPoint::alwaysOn, 0);
- ON_BLOCK_EXIT([&] { waitForIsMasterFailPoint->setMode(FailPoint::off, 0); });
+ auto waitForHelloFailPoint = globalFailPointRegistry().find("waitForHelloResponse");
+ auto timesEnteredFailPoint = waitForHelloFailPoint->setMode(FailPoint::alwaysOn, 0);
+ ON_BLOCK_EXIT([&] { waitForHelloFailPoint->setMode(FailPoint::off, 0); });
// awaitIsMasterResponse blocks and waits on a future when the request TopologyVersion equals
// the current TopologyVersion of the server.
@@ -4779,7 +4779,7 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsOnReplSetReconfig) {
});
// Ensure that awaitIsMasterResponse() is called before triggering a reconfig.
- waitForIsMasterFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
+ waitForHelloFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
// Do a reconfig to add a third node to the replica set. A reconfig should cause the server to
// respond to the waiting IsMasterResponse.
@@ -4910,9 +4910,9 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsOnReplSetReconfigOnSecondary)
auto expectedCounter = currentTopologyVersion.getCounter() + 1;
auto opCtx = makeOperationContext();
- auto waitForIsMasterFailPoint = globalFailPointRegistry().find("waitForIsMasterResponse");
- auto timesEnteredFailPoint = waitForIsMasterFailPoint->setMode(FailPoint::alwaysOn, 0);
- ON_BLOCK_EXIT([&] { waitForIsMasterFailPoint->setMode(FailPoint::off, 0); });
+ auto waitForHelloFailPoint = globalFailPointRegistry().find("waitForHelloResponse");
+ auto timesEnteredFailPoint = waitForHelloFailPoint->setMode(FailPoint::alwaysOn, 0);
+ ON_BLOCK_EXIT([&] { waitForHelloFailPoint->setMode(FailPoint::off, 0); });
// awaitIsMasterResponse blocks and waits on a future when the request TopologyVersion equals
// the current TopologyVersion of the server.
@@ -4931,7 +4931,7 @@ TEST_F(ReplCoordTest, AwaitIsMasterResponseReturnsOnReplSetReconfigOnSecondary)
});
// Ensure that awaitIsMasterResponse() is called before triggering a reconfig.
- waitForIsMasterFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
+ waitForHelloFailPoint->waitForTimesEntered(timesEnteredFailPoint + 1);
// Do a reconfig to remove a node from the replica set. A reconfig should cause the server to
// respond to the waiting isMaster request.