diff options
Diffstat (limited to 'src/mongo/s/client')
-rw-r--r-- | src/mongo/s/client/parallel.cpp | 31 | ||||
-rw-r--r-- | src/mongo/s/client/shard.h | 20 | ||||
-rw-r--r-- | src/mongo/s/client/shard_registry.cpp | 4 | ||||
-rw-r--r-- | src/mongo/s/client/shard_remote.cpp | 1 | ||||
-rw-r--r-- | src/mongo/s/client/shard_remote.h | 8 | ||||
-rw-r--r-- | src/mongo/s/client/sharding_connection_hook.cpp | 4 | ||||
-rw-r--r-- | src/mongo/s/client/version_manager.cpp | 37 |
7 files changed, 44 insertions, 61 deletions
diff --git a/src/mongo/s/client/parallel.cpp b/src/mongo/s/client/parallel.cpp index 3320e4517b7..c532d4b5a23 100644 --- a/src/mongo/s/client/parallel.cpp +++ b/src/mongo/s/client/parallel.cpp @@ -49,9 +49,9 @@ namespace mongo { -using std::shared_ptr; using std::map; using std::set; +using std::shared_ptr; using std::string; using std::vector; @@ -566,10 +566,11 @@ void ParallelSortClusteredCursor::startInit(OperationContext* opCtx) { // shard or if we keep better track of chunks, we can actually add the skip // value into the cursor and/or make some assumptions about the return value // size ( (batch size + skip amount) / num_servers ). - _qSpec.ntoreturn() == 0 ? 0 : (_qSpec.ntoreturn() > 0 - ? _qSpec.ntoreturn() + _qSpec.ntoskip() - : _qSpec.ntoreturn() - - _qSpec.ntoskip()))); // batchSize + _qSpec.ntoreturn() == 0 + ? 0 + : (_qSpec.ntoreturn() > 0 + ? _qSpec.ntoreturn() + _qSpec.ntoskip() + : _qSpec.ntoreturn() - _qSpec.ntoskip()))); // batchSize } else { // Single shard query @@ -598,9 +599,9 @@ void ParallelSortClusteredCursor::startInit(OperationContext* opCtx) { // Without full initialization, throw an exception uassert(15987, - str::stream() << "could not fully initialize cursor on shard " << shardId - << ", current connection state is " - << mdata.toBSON().toString(), + str::stream() + << "could not fully initialize cursor on shard " << shardId + << ", current connection state is " << mdata.toBSON().toString(), success); mdata.retryNext = false; @@ -993,8 +994,7 @@ void ParallelSortClusteredCursor::_oldInit(OperationContext* opCtx) { // Version is zero b/c this is deprecated codepath staleConfigExs.push_back(str::stream() << "stale config detected for " << _ns - << " in ParallelCursor::_init " - << errLoc); + << " in ParallelCursor::_init " << errLoc); break; } @@ -1056,8 +1056,8 @@ void ParallelSortClusteredCursor::_oldInit(OperationContext* opCtx) { _cursors[i].reset(nullptr, nullptr); if (!retry) { - socketExs.push_back(str::stream() << "error querying server: " - << servers[i]); + socketExs.push_back(str::stream() + << "error querying server: " << servers[i]); conns[i]->done(); } else { retryQueries.insert(i); @@ -1277,12 +1277,7 @@ void ParallelConnectionMetadata::cleanup(bool full) { BSONObj ParallelConnectionMetadata::toBSON() const { return BSON("state" << (pcState ? pcState->toBSON() : BSONObj()) << "retryNext" << retryNext - << "init" - << initialized - << "finish" - << finished - << "errored" - << errored); + << "init" << initialized << "finish" << finished << "errored" << errored); } std::string ParallelConnectionState::toString() const { diff --git a/src/mongo/s/client/shard.h b/src/mongo/s/client/shard.h index 69db3fdbc87..44a2c48c43b 100644 --- a/src/mongo/s/client/shard.h +++ b/src/mongo/s/client/shard.h @@ -205,9 +205,9 @@ public: const BSONObj& cmdObj) = 0; /** - * Runs a cursor command, exhausts the cursor, and pulls all data into memory. Performs retries - * if the command fails in accordance with the kIdempotent RetryPolicy. - */ + * Runs a cursor command, exhausts the cursor, and pulls all data into memory. Performs retries + * if the command fails in accordance with the kIdempotent RetryPolicy. + */ StatusWith<QueryResponse> runExhaustiveCursorCommand(OperationContext* opCtx, const ReadPreferenceSetting& readPref, const std::string& dbName, @@ -225,13 +225,13 @@ public: RetryPolicy retryPolicy); /** - * Warning: This method exhausts the cursor and pulls all data into memory. - * Do not use other than for very small (i.e., admin or metadata) collections. - * Performs retries if the query fails in accordance with the kIdempotent RetryPolicy. - * - * ShardRemote instances expect "readConcernLevel" to always be kMajorityReadConcern, whereas - * ShardLocal instances expect either kLocalReadConcern or kMajorityReadConcern. - */ + * Warning: This method exhausts the cursor and pulls all data into memory. + * Do not use other than for very small (i.e., admin or metadata) collections. + * Performs retries if the query fails in accordance with the kIdempotent RetryPolicy. + * + * ShardRemote instances expect "readConcernLevel" to always be kMajorityReadConcern, whereas + * ShardLocal instances expect either kLocalReadConcern or kMajorityReadConcern. + */ StatusWith<QueryResponse> exhaustiveFindOnConfig(OperationContext* opCtx, const ReadPreferenceSetting& readPref, const repl::ReadConcernLevel& readConcernLevel, diff --git a/src/mongo/s/client/shard_registry.cpp b/src/mongo/s/client/shard_registry.cpp index 7187eb01998..a5deb5da0f3 100644 --- a/src/mongo/s/client/shard_registry.cpp +++ b/src/mongo/s/client/shard_registry.cpp @@ -65,17 +65,17 @@ namespace mongo { -using std::shared_ptr; using std::set; +using std::shared_ptr; using std::string; using std::unique_ptr; using std::vector; using executor::NetworkInterface; using executor::NetworkInterfaceThreadPool; +using executor::TaskExecutor; using executor::TaskExecutorPool; using executor::ThreadPoolTaskExecutor; -using executor::TaskExecutor; using CallbackArgs = TaskExecutor::CallbackArgs; using CallbackHandle = TaskExecutor::CallbackHandle; diff --git a/src/mongo/s/client/shard_remote.cpp b/src/mongo/s/client/shard_remote.cpp index 362160babec..8602c3d31d2 100644 --- a/src/mongo/s/client/shard_remote.cpp +++ b/src/mongo/s/client/shard_remote.cpp @@ -261,7 +261,6 @@ StatusWith<Shard::QueryResponse> 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(); diff --git a/src/mongo/s/client/shard_remote.h b/src/mongo/s/client/shard_remote.h index e58ec0a8809..3b19fd8ab0f 100644 --- a/src/mongo/s/client/shard_remote.h +++ b/src/mongo/s/client/shard_remote.h @@ -136,10 +136,10 @@ private: mutable stdx::mutex _lastCommittedOpTimeMutex; /** - * Logical time representing the latest opTime timestamp known to be in this shard's majority - * committed snapshot. Only the latest time is kept because lagged secondaries may return earlier - * times. - */ + * Logical time representing the latest opTime timestamp known to be in this shard's majority + * committed snapshot. Only the latest time is kept because lagged secondaries may return + * earlier times. + */ LogicalTime _lastCommittedOpTime; /** diff --git a/src/mongo/s/client/sharding_connection_hook.cpp b/src/mongo/s/client/sharding_connection_hook.cpp index c16190f3949..cbdad3a1257 100644 --- a/src/mongo/s/client/sharding_connection_hook.cpp +++ b/src/mongo/s/client/sharding_connection_hook.cpp @@ -99,9 +99,7 @@ void ShardingConnectionHook::onCreate(DBClientBase* conn) { uassert(28785, str::stream() << "Unrecognized configsvr mode number: " << configServerModeNumber << ". Range of known configsvr mode numbers is: [" - << minKnownConfigServerMode - << ", " - << maxKnownConfigServerMode + << minKnownConfigServerMode << ", " << maxKnownConfigServerMode << "]", configServerModeNumber >= minKnownConfigServerMode && configServerModeNumber <= maxKnownConfigServerMode); diff --git a/src/mongo/s/client/version_manager.cpp b/src/mongo/s/client/version_manager.cpp index f1cdfbc5e6b..1ffed487065 100644 --- a/src/mongo/s/client/version_manager.cpp +++ b/src/mongo/s/client/version_manager.cpp @@ -48,8 +48,8 @@ namespace mongo { -using std::shared_ptr; using std::map; +using std::shared_ptr; using std::string; namespace { @@ -302,33 +302,24 @@ bool checkShardVersion(OperationContext* opCtx, const ChunkVersion refVersion(refManager->getVersion(shard->getId())); const ChunkVersion currentVersion(manager->getVersion(shard->getId())); - string msg(str::stream() << "manager (" << currentVersion.toString() << " : " - << manager->getSequenceNumber() - << ") " - << "not compatible with reference manager (" - << refVersion.toString() - << " : " - << refManager->getSequenceNumber() - << ") " - << "on shard " - << shard->getId() - << " (" - << shard->getConnString().toString() - << ")"); + string msg(str::stream() + << "manager (" << currentVersion.toString() << " : " + << manager->getSequenceNumber() << ") " + << "not compatible with reference manager (" << refVersion.toString() + << " : " << refManager->getSequenceNumber() << ") " + << "on shard " << shard->getId() << " (" << shard->getConnString().toString() + << ")"); uasserted(StaleConfigInfo(nss, refVersion, currentVersion), msg); } } else if (refManager) { - string msg(str::stream() << "not sharded (" << (!manager ? string("<none>") : str::stream() - << manager->getSequenceNumber()) + string msg(str::stream() << "not sharded (" + << (!manager ? string("<none>") + : str::stream() << manager->getSequenceNumber()) << ") but has reference manager (" - << refManager->getSequenceNumber() - << ") " - << "on conn " - << conn->getServerAddress() - << " (" - << conn_in->getServerAddress() - << ")"); + << refManager->getSequenceNumber() << ") " + << "on conn " << conn->getServerAddress() << " (" + << conn_in->getServerAddress() << ")"); uasserted( StaleConfigInfo(nss, refManager->getVersion(shard->getId()), ChunkVersion::UNSHARDED()), |