summaryrefslogtreecommitdiff
path: root/src/mongo/client
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-30 22:37:31 +0000
commit91b24be9ce86be1001f3845393edcca72186ea79 (patch)
treedfc7f9208205f7f15ed4d2cc6494daa18b54621d /src/mongo/client
parentd09c3eb766b31f66d43cb784c7a68278e55a15cf (diff)
downloadmongo-91b24be9ce86be1001f3845393edcca72186ea79.tar.gz
SERVER-50408 Change NotMaster error name to NotWritablePrimary
(cherry picked from commit 783e113bbb1bfa83630222de5b74fe95530692f0)
Diffstat (limited to 'src/mongo/client')
-rw-r--r--src/mongo/client/dbclient_connection.cpp2
-rw-r--r--src/mongo/client/dbclient_rs.cpp2
-rw-r--r--src/mongo/client/scanning_replica_set_monitor.cpp4
-rw-r--r--src/mongo/client/streamable_replica_set_monitor_error_handler_test.cpp2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/client/dbclient_connection.cpp b/src/mongo/client/dbclient_connection.cpp
index b7bc3ffb3d4..577d131e677 100644
--- a/src/mongo/client/dbclient_connection.cpp
+++ b/src/mongo/client/dbclient_connection.cpp
@@ -815,7 +815,7 @@ void DBClientConnection::handleNotMasterResponse(const BSONObj& replyBody,
auto monitor = ReplicaSetMonitor::get(_parentReplSetName);
if (monitor) {
monitor->failedHost(_serverAddress,
- {ErrorCodes::NotMaster,
+ {ErrorCodes::NotWritablePrimary,
str::stream() << "got not master from: " << _serverAddress
<< " of repl set: " << _parentReplSetName});
}
diff --git a/src/mongo/client/dbclient_rs.cpp b/src/mongo/client/dbclient_rs.cpp
index b58743334c2..c6384b05bed 100644
--- a/src/mongo/client/dbclient_rs.cpp
+++ b/src/mongo/client/dbclient_rs.cpp
@@ -704,7 +704,7 @@ void DBClientReplicaSet::isntMaster() {
// monitor doesn't exist.
_rsm->failedHost(
_masterHost,
- {ErrorCodes::NotMaster, str::stream() << "got not master for: " << _masterHost});
+ {ErrorCodes::NotWritablePrimary, str::stream() << "got not master for: " << _masterHost});
resetMaster();
}
diff --git a/src/mongo/client/scanning_replica_set_monitor.cpp b/src/mongo/client/scanning_replica_set_monitor.cpp
index 62d6def67a8..aa721619971 100644
--- a/src/mongo/client/scanning_replica_set_monitor.cpp
+++ b/src/mongo/client/scanning_replica_set_monitor.cpp
@@ -835,7 +835,7 @@ Status Refresher::receivedIsMasterFromMaster(const HostAndPort& from, const IsMa
// since they don't have the same ordering with pv1 electionId.
if (reply.configVersion < _set->configVersion) {
return {
- ErrorCodes::NotMaster,
+ ErrorCodes::NotWritablePrimary,
str::stream() << "Node " << from << " believes it is primary, but its config version "
<< reply.configVersion << " is older than the most recent config version "
<< _set->configVersion};
@@ -848,7 +848,7 @@ Status Refresher::receivedIsMasterFromMaster(const HostAndPort& from, const IsMa
if (reply.configVersion == _set->configVersion && _set->maxElectionId.isSet() &&
_set->maxElectionId.compare(reply.electionId) > 0) {
return {
- ErrorCodes::NotMaster,
+ ErrorCodes::NotWritablePrimary,
str::stream() << "Node " << from << " believes it is primary, but its election id "
<< reply.electionId << " is older than the most recent election id "
<< _set->maxElectionId};
diff --git a/src/mongo/client/streamable_replica_set_monitor_error_handler_test.cpp b/src/mongo/client/streamable_replica_set_monitor_error_handler_test.cpp
index ef0eb80e61a..497d3d04f2a 100644
--- a/src/mongo/client/streamable_replica_set_monitor_error_handler_test.cpp
+++ b/src/mongo/client/streamable_replica_set_monitor_error_handler_test.cpp
@@ -111,7 +111,7 @@ public:
ErrorCodes::NotMasterOrSecondary,
ErrorCodes::PrimarySteppedDown,
ErrorCodes::ShutdownInProgress,
- ErrorCodes::NotMaster,
+ ErrorCodes::NotWritablePrimary,
ErrorCodes::NotMasterNoSlaveOk};
inline static const std::string kSetName = "setName";