summaryrefslogtreecommitdiff
path: root/src/mongo/rpc
diff options
context:
space:
mode:
authorPavi Vetriselvan <pavithra.vetriselvan@mongodb.com>2020-08-24 12:25:14 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-03 13:19:48 +0000
commit783e113bbb1bfa83630222de5b74fe95530692f0 (patch)
tree1938acb2542c93805331e166f2b638ea25b42c03 /src/mongo/rpc
parente9b6548c82815c7fb900ee7c00e497660a7d610c (diff)
downloadmongo-783e113bbb1bfa83630222de5b74fe95530692f0.tar.gz
SERVER-50408 Change NotMaster error name to NotWritablePrimary
Diffstat (limited to 'src/mongo/rpc')
-rw-r--r--src/mongo/rpc/op_msg_integration_test.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mongo/rpc/op_msg_integration_test.cpp b/src/mongo/rpc/op_msg_integration_test.cpp
index d1b7484548b..a2a380c4f9a 100644
--- a/src/mongo/rpc/op_msg_integration_test.cpp
+++ b/src/mongo/rpc/op_msg_integration_test.cpp
@@ -192,7 +192,7 @@ TEST(OpMsg, DocumentSequenceMaxWriteBatchWorks) {
conn->dropCollection("test.collection");
}
-TEST(OpMsg, CloseConnectionOnFireAndForgetNotMasterError) {
+TEST(OpMsg, CloseConnectionOnFireAndForgetNotWritablePrimaryError) {
const auto connStr = unittest::getFixtureConnectionString();
// This test only works against a replica set.
@@ -219,14 +219,14 @@ TEST(OpMsg, CloseConnectionOnFireAndForgetNotMasterError) {
})"))
.serialize();
- // Round-trip command fails with NotMaster error. Note that this failure is in command
- // dispatch which ignores w:0.
+ // Round-trip command fails with NotWritablePrimary error. Note that this failure is in
+ // command dispatch which ignores w:0.
Message reply;
ASSERT(conn.call(request, reply, /*assertOK*/ true, nullptr));
ASSERT_EQ(
getStatusFromCommandResult(
conn.parseCommandReplyMessage(conn.getServerAddress(), reply)->getCommandReply()),
- ErrorCodes::NotMaster);
+ ErrorCodes::NotWritablePrimary);
// Fire-and-forget closes connection when it sees that error. Note that this is using call()
// rather than say() so that we get an error back when the connection is closed. Normally
@@ -893,7 +893,8 @@ TEST(OpMsg, ExhaustIsMasterMetricDecrementsOnNewOpAfterTerminatingExhaustStream)
<< "failCommand"
<< "mode" << BSON("times" << 1) << "data"
<< BSON("threadName" << threadName << "errorCode"
- << ErrorCodes::NotMaster << "failCommands"
+ << ErrorCodes::NotWritablePrimary
+ << "failCommands"
<< BSON_ARRAY("isMaster")));
auto response = conn2->runCommand(OpMsgRequest::fromDBAndBody("admin", failPointObj));
ASSERT_OK(getStatusFromCommandResult(response->getCommandReply()));
@@ -983,7 +984,8 @@ TEST(OpMsg, ExhaustIsMasterMetricOnNewExhaustIsMasterAfterTerminatingExhaustStre
<< "failCommand"
<< "mode" << BSON("times" << 1) << "data"
<< BSON("threadName" << threadName << "errorCode"
- << ErrorCodes::NotMaster << "failCommands"
+ << ErrorCodes::NotWritablePrimary
+ << "failCommands"
<< BSON_ARRAY("isMaster")));
auto response = conn2->runCommand(OpMsgRequest::fromDBAndBody("admin", failPointObj));
ASSERT_OK(getStatusFromCommandResult(response->getCommandReply()));