summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog/sharding_catalog_client_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/catalog/sharding_catalog_client_impl.cpp')
-rw-r--r--src/mongo/s/catalog/sharding_catalog_client_impl.cpp22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/mongo/s/catalog/sharding_catalog_client_impl.cpp b/src/mongo/s/catalog/sharding_catalog_client_impl.cpp
index 463e46ed9ff..2253e2ab55e 100644
--- a/src/mongo/s/catalog/sharding_catalog_client_impl.cpp
+++ b/src/mongo/s/catalog/sharding_catalog_client_impl.cpp
@@ -36,7 +36,6 @@
#include "mongo/bson/util/bson_extract.h"
#include "mongo/client/read_preference.h"
#include "mongo/client/remote_command_targeter.h"
-#include "mongo/db/catalog_shard_feature_flag_gen.h"
#include "mongo/db/commands.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/operation_context.h"
@@ -324,24 +323,11 @@ std::vector<BSONObj> runCatalogAggregation(OperationContext* opCtx,
AggregateCommandRequest& aggRequest,
const repl::ReadConcernArgs& readConcern,
const Milliseconds& maxTimeout) {
- // Reads on the config server may run on any node in its replica set. Such reads use the config
- // time as an afterClusterTime token, but config time is only inclusive of majority committed
- // data, so we should not use a weaker read concern. Note if the local node is a config server,
- // it can use these concerns safely with a ShardLocal, which would require relaxing this
- // invariant.
- invariant(readConcern.getLevel() == repl::ReadConcernLevel::kMajorityReadConcern ||
- readConcern.getLevel() == repl::ReadConcernLevel::kSnapshotReadConcern ||
- readConcern.getLevel() == repl::ReadConcernLevel::kLinearizableReadConcern,
- str::stream() << "Disallowed read concern: " << readConcern.toBSONInner());
-
aggRequest.setReadConcern(readConcern.toBSONInner());
aggRequest.setWriteConcern(WriteConcernOptions());
const auto readPref = [&]() -> ReadPreferenceSetting {
- if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer &&
- !gFeatureFlagConfigServerAlwaysShardRemote.isEnabledAndIgnoreFCV()) {
- // When the feature flag is on, the config server may read from any node in its replica
- // set, so we should use the typical config server read preference.
+ if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) {
return {};
}
@@ -354,7 +340,6 @@ std::vector<BSONObj> runCatalogAggregation(OperationContext* opCtx,
aggRequest.setUnwrappedReadPref(readPref.toContainingBSON());
if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) {
- // Don't use a timeout on the config server to guarantee it can always refresh.
const Milliseconds maxTimeMS = std::min(opCtx->getRemainingMaxTimeMillis(), maxTimeout);
aggRequest.setMaxTimeMS(durationCount<Milliseconds>(maxTimeMS));
}
@@ -555,10 +540,7 @@ std::vector<ShardId> makeAndRunPlacementHistoryAggregation(
// Run the aggregation
const auto readConcern = [&]() -> repl::ReadConcernArgs {
- if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer &&
- !gFeatureFlagConfigServerAlwaysShardRemote.isEnabledAndIgnoreFCV()) {
- // When the feature flag is on, the config server may read from a secondary which may
- // need to wait for replication, so we should use afterClusterTime.
+ if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) {
return {repl::ReadConcernLevel::kMajorityReadConcern};
} else {
const auto time = VectorClock::get(opCtx)->getTime();