summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuayu Ouyang <huayu.ouyang@mongodb.com>2020-10-08 19:58:08 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-11-29 21:25:33 +0000
commit415c13d84baee5311bd1699fb3431b8b08ac449b (patch)
treef3a07cc297a8fc8045efc1a11bae277afb306c62
parent653efb29e7357524f604e274c786e4ad73d43db2 (diff)
downloadmongo-415c13d84baee5311bd1699fb3431b8b08ac449b.tar.gz
SERVER-51262 Rename skipCheckingForNotMasterInCommandDispatch to skipCheckingForNotPrimaryInCommandDispatch
(cherry picked from commit 3cf1349ab81c57d5b2f2002b030c032094a308f5) (cherry picked from commit 6082fef7f23cb6b1ab2228c1f636263b3809d076)
-rw-r--r--etc/backports_required_for_multiversion_tests.yml4
-rw-r--r--jstests/replsets/read_operations_during_rollback.js2
-rw-r--r--jstests/replsets/transactions_on_secondaries_not_allowed.js2
-rw-r--r--src/mongo/db/service_entry_point_common.cpp4
-rw-r--r--src/mongo/db/service_entry_point_common.h4
-rw-r--r--src/mongo/rpc/op_msg_integration_test.cpp6
6 files changed, 13 insertions, 9 deletions
diff --git a/etc/backports_required_for_multiversion_tests.yml b/etc/backports_required_for_multiversion_tests.yml
index 9f38d10b9dd..77e390a45e8 100644
--- a/etc/backports_required_for_multiversion_tests.yml
+++ b/etc/backports_required_for_multiversion_tests.yml
@@ -74,6 +74,10 @@ all:
test_file: jstests/replsets/ismaster1.js
- ticket: SERVER-49991
test_file: jstests/replsets/get_replication_info_helper.js
+ - ticket: SERVER-51262
+ test_file: jstests/replsets/read_operations_during_rollback.js
+ - ticket: SERVER-51262
+ test_file: jstests/replsets/transactions_on_secondaries_not_allowed.js
# Tests that should only be excluded from particular suites should be listed under that suite.
suites:
diff --git a/jstests/replsets/read_operations_during_rollback.js b/jstests/replsets/read_operations_during_rollback.js
index c4ead83e2c8..57dcc4aacf9 100644
--- a/jstests/replsets/read_operations_during_rollback.js
+++ b/jstests/replsets/read_operations_during_rollback.js
@@ -71,7 +71,7 @@ assert.commandFailedWithCode(rollbackNode.getDB(dbName).runCommand(
// 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.NotPrimaryOrSecondary);
diff --git a/jstests/replsets/transactions_on_secondaries_not_allowed.js b/jstests/replsets/transactions_on_secondaries_not_allowed.js
index 8826fff666c..9205ce41668 100644
--- a/jstests/replsets/transactions_on_secondaries_not_allowed.js
+++ b/jstests/replsets/transactions_on_secondaries_not_allowed.js
@@ -31,7 +31,7 @@ rst.awaitLastOpCommitted();
// Disable the best-effort check for primary-ness in the service entry point, so that we
// exercise the real check for primary-ness in TransactionParticipant::beginOrContinue.
assert.commandWorked(secondary.adminCommand(
- {configureFailPoint: "skipCheckingForNotMasterInCommandDispatch", mode: "alwaysOn"}));
+ {configureFailPoint: "skipCheckingForNotPrimaryInCommandDispatch", mode: "alwaysOn"}));
// Initiate a session on the secondary.
const sessionOptions = {
diff --git a/src/mongo/db/service_entry_point_common.cpp b/src/mongo/db/service_entry_point_common.cpp
index 40d52da8b51..7d9246d7ac5 100644
--- a/src/mongo/db/service_entry_point_common.cpp
+++ b/src/mongo/db/service_entry_point_common.cpp
@@ -99,7 +99,7 @@ namespace mongo {
MONGO_FAIL_POINT_DEFINE(rsStopGetMore);
MONGO_FAIL_POINT_DEFINE(respondWithNotPrimaryInCommandDispatch);
-MONGO_FAIL_POINT_DEFINE(skipCheckingForNotMasterInCommandDispatch);
+MONGO_FAIL_POINT_DEFINE(skipCheckingForNotPrimaryInCommandDispatch);
MONGO_FAIL_POINT_DEFINE(sleepMillisAfterCommandExecutionBegins);
MONGO_FAIL_POINT_DEFINE(waitAfterCommandFinishesExecution);
MONGO_FAIL_POINT_DEFINE(waitAfterNewStatementBlocksBehindPrepare);
@@ -764,7 +764,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)) {
const bool inMultiDocumentTransaction = (sessionOptions.getAutocommit() == false);
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 60fb5f9e2cb..054b5631cec 100644
--- a/src/mongo/db/service_entry_point_common.h
+++ b/src/mongo/db/service_entry_point_common.h
@@ -42,9 +42,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 30138f70cf6..756bebf21f2 100644
--- a/src/mongo/rpc/op_msg_integration_test.cpp
+++ b/src/mongo/rpc/op_msg_integration_test.cpp
@@ -204,12 +204,12 @@ TEST(OpMsg, CloseConnectionOnFireAndForgetNotWritablePrimaryError) {
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))
@@ -219,7 +219,7 @@ TEST(OpMsg, CloseConnectionOnFireAndForgetNotWritablePrimaryError) {
ASSERT(conn.runCommand("admin",
fromjson(R"({
configureFailPoint:
- 'skipCheckingForNotMasterInCommandDispatch',
+ 'skipCheckingForNotPrimaryInCommandDispatch',
mode: 'off'
})"),
output))