summaryrefslogtreecommitdiff
path: root/src/mongo/client/dbclient_rs.cpp
diff options
context:
space:
mode:
authorPavi Vetriselvan <pavithra.vetriselvan@mongodb.com>2020-08-31 07:10:51 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-04 02:23:43 +0000
commite703a72a49151fa782cfd83a654a6af55663ca38 (patch)
tree84f46e54a08e1539fa06a6335836cc58b881ca6b /src/mongo/client/dbclient_rs.cpp
parent49153d63a1a19c8dbbd186a8542609b2e7f41d13 (diff)
downloadmongo-e703a72a49151fa782cfd83a654a6af55663ca38.tar.gz
SERVER-50410 Change NotMasterOrSecondary error code name to NotPrimaryOrSecondary
Diffstat (limited to 'src/mongo/client/dbclient_rs.cpp')
-rw-r--r--src/mongo/client/dbclient_rs.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/client/dbclient_rs.cpp b/src/mongo/client/dbclient_rs.cpp
index 7aaa15adfe8..c4119e83fb7 100644
--- a/src/mongo/client/dbclient_rs.cpp
+++ b/src/mongo/client/dbclient_rs.cpp
@@ -722,11 +722,11 @@ unique_ptr<DBClientCursor> DBClientReplicaSet::checkSlaveQueryResult(
if (!isError)
return result;
- // We only check for "not master or secondary" errors here
+ // We only check for NotPrimaryOrSecondary errors here
// If the error code here ever changes, we need to change this code also
BSONElement code = error["code"];
- if (code.isNumber() && code.Int() == ErrorCodes::NotMasterOrSecondary) {
+ if (code.isNumber() && code.Int() == ErrorCodes::NotPrimaryOrSecondary) {
isntSecondary();
uasserted(14812,
str::stream() << "slave " << _lastSlaveOkHost.toString()
@@ -737,10 +737,10 @@ unique_ptr<DBClientCursor> DBClientReplicaSet::checkSlaveQueryResult(
}
void DBClientReplicaSet::isntSecondary() {
- // Failover to next slave
+ // Failover to next secondary
_getMonitor()->failedHost(
_lastSlaveOkHost,
- {ErrorCodes::NotMasterOrSecondary,
+ {ErrorCodes::NotPrimaryOrSecondary,
str::stream() << "slave no longer has secondary status: " << _lastSlaveOkHost});
resetSlaveOkConn();
@@ -977,7 +977,7 @@ void DBClientReplicaSet::checkResponse(const std::vector<BSONObj>& batch,
if (networkError ||
(hasErrField(dataObj) && !dataObj["code"].eoo() &&
- dataObj["code"].Int() == ErrorCodes::NotMasterOrSecondary)) {
+ dataObj["code"].Int() == ErrorCodes::NotPrimaryOrSecondary)) {
if (_lazyState._lastClient == _lastSlaveOkConn.get()) {
isntSecondary();
} else if (_lazyState._lastClient == _master.get()) {