diff options
author | Huayu Ouyang <huayu.ouyang@mongodb.com> | 2020-10-08 19:58:08 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-11-29 21:11:02 +0000 |
commit | bdcf9e233992f28e1d6e6f5edc9248012228eb58 (patch) | |
tree | ff248673048dec67dee384dce0419a46a40faf72 | |
parent | 19aaba5321fc640337c22aac775e279c49c5b709 (diff) | |
download | mongo-bdcf9e233992f28e1d6e6f5edc9248012228eb58.tar.gz |
SERVER-51262 Rename skipCheckingForNotMasterInCommandDispatch to skipCheckingForNotPrimaryInCommandDispatch
(cherry picked from commit 3cf1349ab81c57d5b2f2002b030c032094a308f5)
(cherry picked from commit 6082fef7f23cb6b1ab2228c1f636263b3809d076)
(cherry picked from commit 5fe1e8e4a8ecfd26f9a9e6f890b02d72a4d46127)
-rw-r--r-- | jstests/replsets/read_operations_during_rollback.js | 2 | ||||
-rw-r--r-- | src/mongo/db/service_entry_point_common.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/service_entry_point_common.h | 4 | ||||
-rw-r--r-- | src/mongo/rpc/op_msg_integration_test.cpp | 6 |
4 files changed, 8 insertions, 8 deletions
diff --git a/jstests/replsets/read_operations_during_rollback.js b/jstests/replsets/read_operations_during_rollback.js index 209e2003c26..b1ba09df24c 100644 --- a/jstests/replsets/read_operations_during_rollback.js +++ b/jstests/replsets/read_operations_during_rollback.js @@ -77,7 +77,7 @@ // Disable the best-effort check for primary-ness in the service entry point, so that we // exercise the real check for primary-ness in 'find' and 'getMore' commands. - setFailPoint(rollbackNode, "skipCheckingForNotMasterInCommandDispatch"); + setFailPoint(rollbackNode, "skipCheckingForNotPrimaryInCommandDispatch"); jsTestLog("Reading during rollback (again with command dispatch checks disabled)."); assert.commandFailedWithCode(rollbackNode.getDB(dbName).runCommand({"find": collName}), ErrorCodes.NotMasterOrSecondary); diff --git a/src/mongo/db/service_entry_point_common.cpp b/src/mongo/db/service_entry_point_common.cpp index 001ba244ec1..2d5b25061f0 100644 --- a/src/mongo/db/service_entry_point_common.cpp +++ b/src/mongo/db/service_entry_point_common.cpp @@ -94,7 +94,7 @@ namespace mongo { MONGO_FAIL_POINT_DEFINE(failCommand); MONGO_FAIL_POINT_DEFINE(rsStopGetMore); MONGO_FAIL_POINT_DEFINE(respondWithNotPrimaryInCommandDispatch); -MONGO_FAIL_POINT_DEFINE(skipCheckingForNotMasterInCommandDispatch); +MONGO_FAIL_POINT_DEFINE(skipCheckingForNotPrimaryInCommandDispatch); namespace { using logger::LogComponent; @@ -774,7 +774,7 @@ void execCommandDatabase(OperationContext* opCtx, const bool iAmPrimary = replCoord->canAcceptWritesForDatabase_UNSAFE(opCtx, dbname); if (!opCtx->getClient()->isInDirectClient() && - !MONGO_FAIL_POINT(skipCheckingForNotMasterInCommandDispatch)) { + !MONGO_FAIL_POINT(skipCheckingForNotPrimaryInCommandDispatch)) { auto inMultiDocumentTransaction = static_cast<bool>(sessionOptions.getAutocommit()); auto allowed = command->secondaryAllowed(opCtx->getServiceContext()); bool alwaysAllowed = allowed == Command::AllowedOnSecondary::kAlways; diff --git a/src/mongo/db/service_entry_point_common.h b/src/mongo/db/service_entry_point_common.h index 95f63cf915c..8d66469bd06 100644 --- a/src/mongo/db/service_entry_point_common.h +++ b/src/mongo/db/service_entry_point_common.h @@ -43,9 +43,9 @@ namespace mongo { MONGO_FAIL_POINT_DECLARE(rsStopGetMore); MONGO_FAIL_POINT_DECLARE(respondWithNotPrimaryInCommandDispatch); -// When active, we won't check if we are master in command dispatch. Activate this if you want to +// When active, we won't check if we are primary in command dispatch. Activate this if you want to // test failing during command execution. -MONGO_FAIL_POINT_DECLARE(skipCheckingForNotMasterInCommandDispatch); +MONGO_FAIL_POINT_DECLARE(skipCheckingForNotPrimaryInCommandDispatch); /** * Helpers for writing ServiceEntryPointImpl implementations from a reusable core. diff --git a/src/mongo/rpc/op_msg_integration_test.cpp b/src/mongo/rpc/op_msg_integration_test.cpp index 9c5f00297ea..757d0facde1 100644 --- a/src/mongo/rpc/op_msg_integration_test.cpp +++ b/src/mongo/rpc/op_msg_integration_test.cpp @@ -129,12 +129,12 @@ TEST(OpMsg, CloseConnectionOnFireAndForgetNotMasterError) { uassertStatusOK(conn.connect(host, "integration_test")); // Reconnect. - // Disable eager checking of master to simulate a stepdown occurring after the check. This + // Disable eager checking of primary to simulate a stepdown occurring after the check. This // should respect w:0. BSONObj output; ASSERT(conn.runCommand("admin", fromjson(R"({ - configureFailPoint: 'skipCheckingForNotMasterInCommandDispatch', + configureFailPoint: 'skipCheckingForNotPrimaryInCommandDispatch', mode: 'alwaysOn' })"), output)) @@ -144,7 +144,7 @@ TEST(OpMsg, CloseConnectionOnFireAndForgetNotMasterError) { ASSERT(conn.runCommand("admin", fromjson(R"({ configureFailPoint: - 'skipCheckingForNotMasterInCommandDispatch', + 'skipCheckingForNotPrimaryInCommandDispatch', mode: 'off' })"), output)) |