diff options
| author | Varun Ravichandran <varun.ravichandran@mongodb.com> | 2023-05-05 21:56:32 +0000 |
|---|---|---|
| committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-05-10 23:53:29 +0000 |
| commit | eb241a9571423c17e68677a443323fd0e8fa47d4 (patch) | |
| tree | 3851aeb7c46cde0d0ef24f6493113b459df73cc2 /src/mongo | |
| parent | 053ff9f355555cddddf3a476ffa9ddf899b1657d (diff) | |
| download | mongo-eb241a9571423c17e68677a443323fd0e8fa47d4.tar.gz | |
SERVER-70689: Remove featureFlagUserRoles
Diffstat (limited to 'src/mongo')
| -rw-r--r-- | src/mongo/db/pipeline/expression.cpp | 17 | ||||
| -rw-r--r-- | src/mongo/db/pipeline/expression_context.cpp | 9 | ||||
| -rw-r--r-- | src/mongo/db/query/query_feature_flags.idl | 7 |
3 files changed, 1 insertions, 32 deletions
diff --git a/src/mongo/db/pipeline/expression.cpp b/src/mongo/db/pipeline/expression.cpp index 0ef3a2db975..932c8404210 100644 --- a/src/mongo/db/pipeline/expression.cpp +++ b/src/mongo/db/pipeline/expression.cpp @@ -2446,23 +2446,6 @@ intrusive_ptr<ExpressionFieldPath> ExpressionFieldPath::parse(ExpressionContext* variableValidation::validateNameForUserRead(varName); auto varId = vps.getVariable(varName); - bool queryFeatureAllowedUserRoles = varId == Variables::kUserRolesId - ? (!expCtx->maxFeatureCompatibilityVersion || - feature_flags::gFeatureFlagUserRoles.isEnabledOnVersion( - *expCtx->maxFeatureCompatibilityVersion)) - : true; - - uassert( - ErrorCodes::QueryFeatureNotAllowed, - // We would like to include the current version and the required minimum version in this - // error message, but using FeatureCompatibilityVersion::toString() would introduce a - // dependency cycle (see SERVER-31968). - str::stream() - << "$$USER_ROLES is not allowed in the current feature compatibility version. See " - << feature_compatibility_version_documentation::kCompatibilityLink - << " for more information.", - queryFeatureAllowedUserRoles); - // If the variable we are parsing is a system variable, then indicate that we have seen it. if (!Variables::isUserDefinedVariable(varId)) { expCtx->setSystemVarReferencedInQuery(varId); diff --git a/src/mongo/db/pipeline/expression_context.cpp b/src/mongo/db/pipeline/expression_context.cpp index ac7de6d9d71..c171cca3cda 100644 --- a/src/mongo/db/pipeline/expression_context.cpp +++ b/src/mongo/db/pipeline/expression_context.cpp @@ -314,14 +314,7 @@ void ExpressionContext::stopExpressionCounters() { void ExpressionContext::setUserRoles() { // Only set the value of $$USER_ROLES if it is referenced in the query. - // We need to check the FCV here because the $$USER_ROLES variable will always appear in the - // serialized command when one shard is sending a sub-query to another shard. The query will - // fail in the case where the shards are running different binVersions and one of them does not - // have a notion of this variable. This FCV check prevents this from happening, as the value of - // the variable is not set (and therefore not serialized) if the FCV is too old. - if (isSystemVarReferencedInQuery(Variables::kUserRolesId) && - feature_flags::gFeatureFlagUserRoles.isEnabled(serverGlobalParams.featureCompatibility) && - enableAccessToUserRoles.load()) { + if (isSystemVarReferencedInQuery(Variables::kUserRolesId) && enableAccessToUserRoles.load()) { variables.defineUserRoles(opCtx); } } diff --git a/src/mongo/db/query/query_feature_flags.idl b/src/mongo/db/query/query_feature_flags.idl index d2e76bb6bc7..ac707ccbf0a 100644 --- a/src/mongo/db/query/query_feature_flags.idl +++ b/src/mongo/db/query/query_feature_flags.idl @@ -117,13 +117,6 @@ feature_flags: version: 7.0 shouldBeFCVGated: true - featureFlagUserRoles: - description: "Feature flag to enable usage of $$USER_ROLES." - cpp_varname: gFeatureFlagUserRoles - default: true - version: 7.0 - shouldBeFCVGated: true - featureFlagApproxPercentiles: description: "Feature flag to enable approximate $percentile accumulator/expression." cpp_varname: gFeatureFlagApproxPercentiles |
