diff options
author | Misha Tyulenev <misha@mongodb.com> | 2020-03-12 11:53:58 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-12 17:49:34 +0000 |
commit | 729b70ce06625ed73b023a6a41a1e4d1a7e58363 (patch) | |
tree | c3f099118abd88430fb505fef4b35f72f9ede2a0 /src/mongo/executor | |
parent | bb741a0ab1b2c80844dab55a3beecd83a8250ca4 (diff) | |
download | mongo-729b70ce06625ed73b023a6a41a1e4d1a7e58363.tar.gz |
SERVER-46512 do not use baton to run hedge requests
Diffstat (limited to 'src/mongo/executor')
-rw-r--r-- | src/mongo/executor/connection_pool.cpp | 11 | ||||
-rw-r--r-- | src/mongo/executor/network_interface_tl.cpp | 12 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/mongo/executor/connection_pool.cpp b/src/mongo/executor/connection_pool.cpp index 0cc26800c65..4738ee69971 100644 --- a/src/mongo/executor/connection_pool.cpp +++ b/src/mongo/executor/connection_pool.cpp @@ -92,10 +92,21 @@ void ConnectionPool::ConnectionInterface::indicateUsed() { } void ConnectionPool::ConnectionInterface::indicateSuccess() { + LOGV2_DEBUG(4651201, + 4, + "Success indicated for connection", + "getHostAndPort"_attr = getHostAndPort(), + "generation"_attr = getGeneration()); _status = Status::OK(); } void ConnectionPool::ConnectionInterface::indicateFailure(Status status) { + LOGV2_DEBUG(4651202, + 4, + "Failure indicated for connection", + "getHostAndPort"_attr = getHostAndPort(), + "generation"_attr = getGeneration(), + "status"_attr = status.toString()); _status = std::move(status); } diff --git a/src/mongo/executor/network_interface_tl.cpp b/src/mongo/executor/network_interface_tl.cpp index fbd19671d2c..a41f7e8be2b 100644 --- a/src/mongo/executor/network_interface_tl.cpp +++ b/src/mongo/executor/network_interface_tl.cpp @@ -327,6 +327,12 @@ void NetworkInterfaceTL::RequestState::returnConnection(Status status) noexcept auto connToReturn = std::exchange(conn, {}); + LOGV2_DEBUG(4651200, + logSeverityV1toV2(kDiagnosticLogLevel).toInt(), + "Returning a connection to the pool", + "status"_attr = status.toString(), + "is_hedge"_attr = isHedge); + if (!status.isOK()) { connToReturn->indicateFailure(std::move(status)); return; @@ -429,7 +435,11 @@ Status NetworkInterfaceTL::startCommand(const TaskExecutor::CallbackHandle& cbHa if (cmdState->requestOnAny.timeout != cmdState->requestOnAny.kNoTimeout) { cmdState->deadline = cmdState->stopwatch.start() + cmdState->requestOnAny.timeout; } - cmdState->baton = baton; + + // TODO: SERVER-46821 + if (!cmdState->requestOnAny.hedgeOptions) { + cmdState->baton = baton; + } if (_svcCtx && cmdState->requestOnAny.hedgeOptions) { auto hm = HedgingMetrics::get(_svcCtx); |