diff options
author | David Storch <david.storch@10gen.com> | 2015-08-21 11:17:18 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2015-08-24 09:31:13 -0400 |
commit | dd15f9c211f5bc40b6fa8a7cd44350d3aeb87d89 (patch) | |
tree | c5dd533a814bf498f3aec4a7b52b1c707af5eb11 /src/mongo/s/query/cluster_find.cpp | |
parent | 9140a197d93251d262e4f241e9d3b371ea8f5c2b (diff) | |
download | mongo-dd15f9c211f5bc40b6fa8a7cd44350d3aeb87d89.tar.gz |
SERVER-18849 only send wire version for find/getMore commands if config server mode is CSRS
A mongod will return a maxWireVersion of 4 to indicate support for the find and
getMore commands. In constrast, mongos will only return maxWireVersion of 4 if
configured with CSRS, as full find/getMore command support is predicated on
config server as a replica set.
Diffstat (limited to 'src/mongo/s/query/cluster_find.cpp')
-rw-r--r-- | src/mongo/s/query/cluster_find.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/s/query/cluster_find.cpp b/src/mongo/s/query/cluster_find.cpp index 5db9e202564..7441a613124 100644 --- a/src/mongo/s/query/cluster_find.cpp +++ b/src/mongo/s/query/cluster_find.cpp @@ -141,6 +141,14 @@ StatusWith<CursorId> runQueryWithoutRetrying(OperationContext* txn, params.remotes.resize(shards.size()); for (size_t i = 0; i < shards.size(); ++i) { const auto& shard = shards[i]; + + // The find command cannot be used to query config server content with legacy 3-host config + // servers, because the new targeting logic only works for config server replica sets. + if (shard->isConfig() && shard->getConnString().type() == ConnectionString::SYNC) { + return Status(ErrorCodes::CommandNotSupported, + "find command not supported without config server as a replica set"); + } + auto targeter = shard->getTargeter(); auto hostAndPort = targeter->findHost(readPref); if (!hostAndPort.isOK()) { |