From 3f62170f634d76afd82597b512f0e1ac1656d3ae Mon Sep 17 00:00:00 2001 From: Cheahuychou Mao Date: Tue, 19 May 2020 10:26:33 -0400 Subject: SERVER-26755 Increase the timeout for find operations against config.chunks (cherry picked from commit fa03802cb9b42818dd2180f966dd8da64203186a) --- src/mongo/s/client/shard_remote.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mongo/s/client/shard_remote.cpp b/src/mongo/s/client/shard_remote.cpp index e272353c854..df184618bf8 100644 --- a/src/mongo/s/client/shard_remote.cpp +++ b/src/mongo/s/client/shard_remote.cpp @@ -77,6 +77,9 @@ MONGO_EXPORT_SERVER_PARAMETER(internalProhibitShardOperationRetry, bool, internalProhibitShardOperationRetryByDefault); +constexpr int findChunksOnConfigTimeoutMSDefault = 900000; +MONGO_EXPORT_SERVER_PARAMETER(findChunksOnConfigTimeoutMS, int, findChunksOnConfigTimeoutMSDefault); + /** * Returns a new BSONObj describing the same command and arguments as 'cmdObj', but with maxTimeMS * replaced by maxTimeMSOverride (or removed if maxTimeMSOverride is Milliseconds::max()). @@ -280,7 +283,6 @@ StatusWith ShardRemote::_runExhaustiveCursorCommand( auto fetcherCallback = [&status, &response](const Fetcher::QueryResponseStatus& dataStatus, Fetcher::NextAction* nextAction, BSONObjBuilder* getMoreBob) { - // Throw out any accumulated results on error if (!dataStatus.isOK()) { status = dataStatus.getStatus(); @@ -373,7 +375,9 @@ StatusWith ShardRemote::_exhaustiveFindOnConfig( } const Milliseconds maxTimeMS = - std::min(opCtx->getRemainingMaxTimeMillis(), kDefaultConfigCommandTimeout); + std::min(opCtx->getRemainingMaxTimeMillis(), + nss == ChunkType::ConfigNS ? Milliseconds(findChunksOnConfigTimeoutMS.load()) + : kDefaultConfigCommandTimeout); BSONObjBuilder findCmdBuilder; -- cgit v1.2.1