summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl
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-10-30 14:31:38 +0000
commit307962d5aaaa80c492c78a773a8674215f3fcf30 (patch)
tree29616f10374d850b53355768344c73bd568ca0a2 /src/mongo/db/repl
parent8a82e657222fb2920c05aa0941f3e68aa191cd7d (diff)
downloadmongo-307962d5aaaa80c492c78a773a8674215f3fcf30.tar.gz
SERVER-50410 Change NotMasterOrSecondary error code name to NotPrimaryOrSecondary
(cherry picked from commit e703a72a49151fa782cfd83a654a6af55663ca38) (cherry picked from commit 06b1ee3f6877798c91a4b4f2a9984e6e0054ca16)
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r--src/mongo/db/repl/replication_coordinator.h2
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.cpp4
-rw-r--r--src/mongo/db/repl/topology_coordinator.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/db/repl/replication_coordinator.h b/src/mongo/db/repl/replication_coordinator.h
index f32a88536e1..42ead8e2519 100644
--- a/src/mongo/db/repl/replication_coordinator.h
+++ b/src/mongo/db/repl/replication_coordinator.h
@@ -708,7 +708,7 @@ public:
* Returns Status::OK() if all updates are processed correctly, NodeNotFound
* if any updating node cannot be found in the config, InvalidReplicaSetConfig if the
* "configVersion" sent in any of the updates doesn't match our config version, or
- * NotMasterOrSecondary if we are in state REMOVED or otherwise don't have a valid
+ * NotPrimaryOrSecondary if we are in state REMOVED or otherwise don't have a valid
* replica set config.
* If a non-OK status is returned, it is unspecified whether none or some of the updates
* were applied.
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp
index 8d8c93fbe2b..1a69efabf2e 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.cpp
+++ b/src/mongo/db/repl/replication_coordinator_impl.cpp
@@ -2325,7 +2325,7 @@ Status ReplicationCoordinatorImpl::checkCanServeReadsFor_UNSAFE(OperationContext
stdx::lock_guard<Latch> lock(_mutex);
if ((_memberState.startup() && client->isFromUserConnection()) || _memberState.startup2() ||
_memberState.rollback()) {
- return Status{ErrorCodes::NotMasterOrSecondary,
+ return Status{ErrorCodes::NotPrimaryOrSecondary,
"Oplog collection reads are not allowed while in the rollback or "
"startup state."};
}
@@ -2346,7 +2346,7 @@ Status ReplicationCoordinatorImpl::checkCanServeReadsFor_UNSAFE(OperationContext
if (isPrimaryOrSecondary) {
return Status::OK();
}
- return Status(ErrorCodes::NotMasterOrSecondary,
+ return Status(ErrorCodes::NotPrimaryOrSecondary,
"not master or secondary; cannot currently read from this replSet member");
}
return Status(ErrorCodes::NotPrimaryNoSecondaryOk, "not master and slaveOk=false");
diff --git a/src/mongo/db/repl/topology_coordinator.cpp b/src/mongo/db/repl/topology_coordinator.cpp
index 2caaddd5c33..b9d622df06c 100644
--- a/src/mongo/db/repl/topology_coordinator.cpp
+++ b/src/mongo/db/repl/topology_coordinator.cpp
@@ -1067,7 +1067,7 @@ StatusWith<bool> TopologyCoordinator::setLastOptime(const UpdatePositionArgs::Up
long long* configVersion) {
if (_selfIndex == -1) {
// Ignore updates when we're in state REMOVED.
- return Status(ErrorCodes::NotMasterOrSecondary,
+ return Status(ErrorCodes::NotPrimaryOrSecondary,
"Received replSetUpdatePosition command but we are in state REMOVED");
}
invariant(_rsConfig.isInitialized()); // Can only use setLastOptime in replSet mode.