summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheahuychou Mao <mao.cheahuychou@gmail.com>2021-03-14 20:43:05 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-04-07 14:42:24 +0000
commitc2566e29b96559ac5ba4c8616a357c4025a0f843 (patch)
tree7cc1e98542e7d9df49c8e715b02e82c61c5bd7ec
parente59d95b4dc565bade90426730a9415bc9be50e07 (diff)
SERVER-54157 Remove maxWait from comments for findHost and getHostOrRefreshr5.0.0-alpha
-rw-r--r--src/mongo/client/remote_command_targeter.h10
-rw-r--r--src/mongo/client/remote_command_targeter_rs.cpp6
-rw-r--r--src/mongo/client/replica_set_monitor_interface.h6
3 files changed, 6 insertions, 16 deletions
diff --git a/src/mongo/client/remote_command_targeter.h b/src/mongo/client/remote_command_targeter.h
index a457bb74944..a8fe582674c 100644
--- a/src/mongo/client/remote_command_targeter.h
+++ b/src/mongo/client/remote_command_targeter.h
@@ -57,11 +57,9 @@ public:
virtual ConnectionString connectionString() = 0;
/**
- * Finds a host matching readPref blocking up to 20 seconds or until the given operation is
+ * Finds a host matching readPref blocking up to
+ * ReplicaSetMonitorInterface::kDefaultFindHostTimeout seconds or until the given operation is
* interrupted or its deadline expires.
- *
- * TODO(schwerin): Once operation max-time behavior is more uniformly integrated into sharding,
- * remove the 20-second ceiling on wait time.
*/
virtual StatusWith<HostAndPort> findHost(OperationContext* opCtx,
const ReadPreferenceSetting& readPref) = 0;
@@ -69,8 +67,8 @@ public:
/**
* Finds a host that matches the read preference specified by readPref, blocking for up to
- * specified maxWait milliseconds, if a match cannot be found immediately.
- *
+ * ReplicaSetMonitorInterface::kDefaultFindHostTimeout seconds, if a match cannot be found
+ * immediately.
* DEPRECATED. Prefer findHost(OperationContext*, const ReadPreferenceSetting&), whenever
* an OperationContext is available.
*/
diff --git a/src/mongo/client/remote_command_targeter_rs.cpp b/src/mongo/client/remote_command_targeter_rs.cpp
index f1b99732569..2c0f64e3c4a 100644
--- a/src/mongo/client/remote_command_targeter_rs.cpp
+++ b/src/mongo/client/remote_command_targeter_rs.cpp
@@ -81,10 +81,8 @@ StatusWith<HostAndPort> RemoteCommandTargeterRS::findHost(OperationContext* opCt
return interruptStatus;
}
- // Enforce a 20-second ceiling on the time spent looking for a host. This conforms with the
- // behavior used throughout mongos prior to version 3.4, but is not fundamentally desirable.
- // See comment in remote_command_targeter.h for details.
- bool maxTimeMsLesser = (opCtx->getRemainingMaxTimeMillis() < Milliseconds(Seconds(20)));
+ bool maxTimeMsLesser =
+ (opCtx->getRemainingMaxTimeMillis() < ReplicaSetMonitorInterface::kDefaultFindHostTimeout);
auto swHostAndPort =
_rsMonitor->getHostOrRefresh(readPref, opCtx->getCancellationToken()).getNoThrow(opCtx);
diff --git a/src/mongo/client/replica_set_monitor_interface.h b/src/mongo/client/replica_set_monitor_interface.h
index d632830cc79..3fbd5bd5f4e 100644
--- a/src/mongo/client/replica_set_monitor_interface.h
+++ b/src/mongo/client/replica_set_monitor_interface.h
@@ -69,12 +69,6 @@ public:
* Returns a host matching the given read preference or an error, if no host matches.
*
* @param readPref Read preference to match against
- * @param maxWait If no host is readily available that matches the specified read preference,
- * wait for one to become available for up to the specified time and periodically refresh
- * the view of the set. The call may return with an error earlier than the specified value,
- * if none of the known hosts for the set are reachable within some number of attempts.
- * Note that if a maxWait of 0ms is specified, this method may still attempt to contact
- * every host in the replica set up to one time.
* @param excludedHosts List of hosts that are not eligible to be chosen.
*
* Known errors are: