diff options
author | Gabriel Russell <gabriel.russell@mongodb.com> | 2020-10-19 12:52:15 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-11-09 16:58:10 +0000 |
commit | acff91727f94716ca3f1a1e3d8d839d17f07b3d9 (patch) | |
tree | a354b59edb3d38103a5e79cbce915fd2b3f7afa7 | |
parent | 8e777baedf13e0ee2cc366ef6a6420e0badcf0d2 (diff) | |
download | mongo-acff91727f94716ca3f1a1e3d8d839d17f07b3d9.tar.gz |
SERVER-50510 Change markHostNotMaster to markHostNotPrimary
9 files changed, 13 insertions, 13 deletions
diff --git a/src/mongo/client/remote_command_targeter.h b/src/mongo/client/remote_command_targeter.h index 6e9cfcd582f..4c42a499ba0 100644 --- a/src/mongo/client/remote_command_targeter.h +++ b/src/mongo/client/remote_command_targeter.h @@ -81,11 +81,11 @@ public: const ReadPreferenceSetting& readPref, Milliseconds maxWait) = 0; /** - * Reports to the targeter that a 'status' indicating a not master error was received when + * Reports to the targeter that a 'status' indicating a not primary error was received when * communicating with 'host', and so it should update its bookkeeping to avoid giving out the * host again on a subsequent request for the primary. */ - virtual void markHostNotMaster(const HostAndPort& host, const Status& status) = 0; + virtual void markHostNotPrimary(const HostAndPort& host, const Status& status) = 0; /** * Reports to the targeter that a 'status' indicating a network error was received when trying diff --git a/src/mongo/client/remote_command_targeter_factory_mock.cpp b/src/mongo/client/remote_command_targeter_factory_mock.cpp index 0aaafa8d301..f91d2c947a7 100644 --- a/src/mongo/client/remote_command_targeter_factory_mock.cpp +++ b/src/mongo/client/remote_command_targeter_factory_mock.cpp @@ -57,8 +57,8 @@ public: return _mock->findHostsWithMaxWait(readPref, maxWait); } - void markHostNotMaster(const HostAndPort& host, const Status& status) override { - _mock->markHostNotMaster(host, status); + void markHostNotPrimary(const HostAndPort& host, const Status& status) override { + _mock->markHostNotPrimary(host, status); } void markHostUnreachable(const HostAndPort& host, const Status& status) override { diff --git a/src/mongo/client/remote_command_targeter_mock.cpp b/src/mongo/client/remote_command_targeter_mock.cpp index e643a1af8c7..78c06c981dd 100644 --- a/src/mongo/client/remote_command_targeter_mock.cpp +++ b/src/mongo/client/remote_command_targeter_mock.cpp @@ -74,7 +74,7 @@ SemiFuture<std::vector<HostAndPort>> RemoteCommandTargeterMock::findHostsWithMax return _findHostReturnValue; } -void RemoteCommandTargeterMock::markHostNotMaster(const HostAndPort& host, const Status& status) { +void RemoteCommandTargeterMock::markHostNotPrimary(const HostAndPort& host, const Status& status) { stdx::lock_guard<Latch> lg(_mutex); _hostsMarkedDown.insert(host); } diff --git a/src/mongo/client/remote_command_targeter_mock.h b/src/mongo/client/remote_command_targeter_mock.h index 1b89b08dde7..ee7d6188e80 100644 --- a/src/mongo/client/remote_command_targeter_mock.h +++ b/src/mongo/client/remote_command_targeter_mock.h @@ -67,7 +67,7 @@ public: /** * Adds host to a set of hosts marked down, otherwise a no-op. */ - void markHostNotMaster(const HostAndPort& host, const Status& status) override; + void markHostNotPrimary(const HostAndPort& host, const Status& status) override; /** * Adds host to a set of hosts marked down, otherwise a no-op. @@ -104,7 +104,7 @@ private: // Protects _hostsMarkedDown. mutable Mutex _mutex = MONGO_MAKE_LATCH("RemoteCommandTargeterMock::_mutex"); - // HostAndPorts marked not master or unreachable. Meant to verify a code path updates the + // HostAndPorts marked not primary or unreachable. Meant to verify a code path updates the // RemoteCommandTargeterMock. std::set<HostAndPort> _hostsMarkedDown; }; diff --git a/src/mongo/client/remote_command_targeter_rs.cpp b/src/mongo/client/remote_command_targeter_rs.cpp index ce84a13e028..7ddd9898769 100644 --- a/src/mongo/client/remote_command_targeter_rs.cpp +++ b/src/mongo/client/remote_command_targeter_rs.cpp @@ -98,7 +98,7 @@ StatusWith<HostAndPort> RemoteCommandTargeterRS::findHost(OperationContext* opCt return swHostAndPort; } -void RemoteCommandTargeterRS::markHostNotMaster(const HostAndPort& host, const Status& status) { +void RemoteCommandTargeterRS::markHostNotPrimary(const HostAndPort& host, const Status& status) { invariant(_rsMonitor); _rsMonitor->failedHost(host, status); diff --git a/src/mongo/client/remote_command_targeter_rs.h b/src/mongo/client/remote_command_targeter_rs.h index e40d55b8137..84f557dcc12 100644 --- a/src/mongo/client/remote_command_targeter_rs.h +++ b/src/mongo/client/remote_command_targeter_rs.h @@ -62,7 +62,7 @@ public: SemiFuture<HostAndPort> findHostWithMaxWait(const ReadPreferenceSetting& readPref, Milliseconds maxWait) override; - void markHostNotMaster(const HostAndPort& host, const Status& status) override; + void markHostNotPrimary(const HostAndPort& host, const Status& status) override; void markHostUnreachable(const HostAndPort& host, const Status& status) override; diff --git a/src/mongo/client/remote_command_targeter_standalone.cpp b/src/mongo/client/remote_command_targeter_standalone.cpp index c41f759004f..4eb0dc25350 100644 --- a/src/mongo/client/remote_command_targeter_standalone.cpp +++ b/src/mongo/client/remote_command_targeter_standalone.cpp @@ -58,8 +58,8 @@ StatusWith<HostAndPort> RemoteCommandTargeterStandalone::findHost( return _hostAndPort; } -void RemoteCommandTargeterStandalone::markHostNotMaster(const HostAndPort& host, - const Status& status) { +void RemoteCommandTargeterStandalone::markHostNotPrimary(const HostAndPort& host, + const Status& status) { dassert(host == _hostAndPort); } diff --git a/src/mongo/client/remote_command_targeter_standalone.h b/src/mongo/client/remote_command_targeter_standalone.h index 7efd12e93b2..5c11ebcbb32 100644 --- a/src/mongo/client/remote_command_targeter_standalone.h +++ b/src/mongo/client/remote_command_targeter_standalone.h @@ -54,7 +54,7 @@ public: SemiFuture<std::vector<HostAndPort>> findHostsWithMaxWait(const ReadPreferenceSetting& readPref, Milliseconds maxWait) override; - void markHostNotMaster(const HostAndPort& host, const Status& status) override; + void markHostNotPrimary(const HostAndPort& host, const Status& status) override; void markHostUnreachable(const HostAndPort& host, const Status& status) override; diff --git a/src/mongo/s/client/shard_remote.cpp b/src/mongo/s/client/shard_remote.cpp index f00195470dc..5254c24d37d 100644 --- a/src/mongo/s/client/shard_remote.cpp +++ b/src/mongo/s/client/shard_remote.cpp @@ -130,7 +130,7 @@ void ShardRemote::updateReplSetMonitor(const HostAndPort& remoteHost, return; if (ErrorCodes::isNotPrimaryError(remoteCommandStatus.code())) { - _targeter->markHostNotMaster(remoteHost, remoteCommandStatus); + _targeter->markHostNotPrimary(remoteHost, remoteCommandStatus); } else if (ErrorCodes::isNetworkError(remoteCommandStatus.code())) { _targeter->markHostUnreachable(remoteHost, remoteCommandStatus); } else if (remoteCommandStatus == ErrorCodes::NetworkInterfaceExceededTimeLimit) { |