diff options
author | Allison Easton <allison.easton@mongodb.com> | 2023-05-11 16:12:39 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-05-11 18:45:42 +0000 |
commit | f9de98ae11d27a246632cd9b5148ef2ad08cd40b (patch) | |
tree | 18072769f8e18b3c81240e2133bbbded162465d4 | |
parent | e4ddf04d04f39b2e319ce30b1570a78d0bfa7173 (diff) | |
download | mongo-f9de98ae11d27a246632cd9b5148ef2ad08cd40b.tar.gz |
SERVER-77027 Only check for direct shard connections if sharding is enabled
-rw-r--r-- | src/mongo/db/service_entry_point_common.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/service_entry_point_common.cpp b/src/mongo/db/service_entry_point_common.cpp index 05cb0f17155..801a57e184c 100644 --- a/src/mongo/db/service_entry_point_common.cpp +++ b/src/mongo/db/service_entry_point_common.cpp @@ -1729,7 +1729,8 @@ void ExecCommandDatabase::_initiateCommand() { // Check that the client has the directShardOperations role if this is a direct operation to a // shard. - if (command->requiresAuth() && serverGlobalParams.featureCompatibility.isVersionInitialized() && + if (command->requiresAuth() && ShardingState::get(opCtx)->enabled() && + serverGlobalParams.featureCompatibility.isVersionInitialized() && feature_flags::gCheckForDirectShardOperations.isEnabled( serverGlobalParams.featureCompatibility)) { bool clusterHasTwoOrMoreShards = [&]() { |