From dd15f9c211f5bc40b6fa8a7cd44350d3aeb87d89 Mon Sep 17 00:00:00 2001 From: David Storch Date: Fri, 21 Aug 2015 11:17:18 -0400 Subject: 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. --- src/mongo/s/query/cluster_find.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mongo/s/query/cluster_find.cpp') 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 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()) { -- cgit v1.2.1