summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaddie Zechar <mez2113@columbia.edu>2022-01-04 19:05:28 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-04 19:52:51 +0000
commit4313a0ff6dc419431998017a20c035439fb083af (patch)
tree68275d8fde733f564340ece32ff02335fe4f55f8
parentab91beea0deb3f4ca5929066b9ba23a0cfc7796c (diff)
downloadmongo-4313a0ff6dc419431998017a20c035439fb083af.tar.gz
SERVER-62019: Remove flag guard from linearFill
-rw-r--r--jstests/aggregation/sources/setWindowFields/locf.js5
-rw-r--r--src/mongo/db/pipeline/accumulator_locf.cpp4
-rw-r--r--src/mongo/db/pipeline/document_source_fill.cpp4
-rw-r--r--src/mongo/db/pipeline/window_function/window_function_expression.cpp8
-rw-r--r--src/mongo/db/query/query_feature_flags.idl19
5 files changed, 26 insertions, 14 deletions
diff --git a/jstests/aggregation/sources/setWindowFields/locf.js b/jstests/aggregation/sources/setWindowFields/locf.js
index b6a7d7960b6..8038c2cbc1b 100644
--- a/jstests/aggregation/sources/setWindowFields/locf.js
+++ b/jstests/aggregation/sources/setWindowFields/locf.js
@@ -12,6 +12,11 @@ load("jstests/aggregation/extras/window_function_helpers.js");
load("jstests/aggregation/extras/utils.js"); // For arrayEq.
load("jstests/libs/feature_flag_util.js"); // For isEnabled.
+if (!FeatureFlagUtil.isEnabled(db, "Locf")) {
+ jsTestLog("Skipping as featureFlagLocf is not enabled");
+ return;
+}
+
const coll = db[jsTestName()];
coll.drop();
diff --git a/src/mongo/db/pipeline/accumulator_locf.cpp b/src/mongo/db/pipeline/accumulator_locf.cpp
index 9d7749e6a5a..01ac81bf029 100644
--- a/src/mongo/db/pipeline/accumulator_locf.cpp
+++ b/src/mongo/db/pipeline/accumulator_locf.cpp
@@ -41,8 +41,8 @@ namespace mongo {
REGISTER_WINDOW_FUNCTION_CONDITIONALLY(
locf,
mongo::window_function::ExpressionFromLeftUnboundedWindowFunction<AccumulatorLocf>::parse,
- multiversion::FeatureCompatibilityVersion::kVersion_5_2,
- true);
+ feature_flags::gFeatureFlagLocf.getVersion(),
+ feature_flags::gFeatureFlagLocf.isEnabledAndIgnoreFCV());
AccumulatorLocf::AccumulatorLocf(ExpressionContext* const expCtx)
: AccumulatorForWindowFunctions(expCtx) {
diff --git a/src/mongo/db/pipeline/document_source_fill.cpp b/src/mongo/db/pipeline/document_source_fill.cpp
index 282ca7586f2..beb335bf31f 100644
--- a/src/mongo/db/pipeline/document_source_fill.cpp
+++ b/src/mongo/db/pipeline/document_source_fill.cpp
@@ -44,8 +44,8 @@ REGISTER_DOCUMENT_SOURCE_CONDITIONALLY(fill,
document_source_fill::createFromBson,
AllowedWithApiStrict::kNeverInVersion1,
AllowedWithClientType::kAny,
- multiversion::FeatureCompatibilityVersion::kVersion_5_2,
- feature_flags::gFlagFill.isEnabledAndIgnoreFCV());
+ feature_flags::gFeatureFlagFill.getVersion(),
+ feature_flags::gFeatureFlagFill.isEnabledAndIgnoreFCV());
namespace document_source_fill {
std::list<boost::intrusive_ptr<DocumentSource>> createFromBson(
diff --git a/src/mongo/db/pipeline/window_function/window_function_expression.cpp b/src/mongo/db/pipeline/window_function/window_function_expression.cpp
index 10229d9eedb..cd5d3ad6da8 100644
--- a/src/mongo/db/pipeline/window_function/window_function_expression.cpp
+++ b/src/mongo/db/pipeline/window_function/window_function_expression.cpp
@@ -58,9 +58,11 @@ REGISTER_WINDOW_FUNCTION(derivative, ExpressionDerivative::parse);
REGISTER_WINDOW_FUNCTION(first, ExpressionFirst::parse);
REGISTER_WINDOW_FUNCTION(last, ExpressionLast::parse);
REGISTER_WINDOW_FUNCTION_CONDITIONALLY(linearFill,
- ExpressionLinearFill::parse,
- multiversion::FeatureCompatibilityVersion::kVersion_5_2,
- feature_flags::gFlagFill.isEnabledAndIgnoreFCV());
+ (ExpressionLinearFill::parse),
+ feature_flags::gFeatureFlagFill.getVersion(),
+ feature_flags::gFeatureFlagFill.isEnabledAndIgnoreFCV());
+// TODO SERVER-52247 Replace boost::none with 'gFeatureFlagExactTopNAccumulator.getVersion()' below
+// once 'gFeatureFlagExactTopNAccumulator' is set to true by default and is configured with an FCV.
REGISTER_WINDOW_FUNCTION_CONDITIONALLY(
minN,
(ExpressionN<WindowFunctionMinN, AccumulatorMinN>::parse),
diff --git a/src/mongo/db/query/query_feature_flags.idl b/src/mongo/db/query/query_feature_flags.idl
index 5607f3069f7..17a33beb4be 100644
--- a/src/mongo/db/query/query_feature_flags.idl
+++ b/src/mongo/db/query/query_feature_flags.idl
@@ -82,13 +82,6 @@ feature_flags:
cpp_varname: gFeatureFlagSbePlanCache
default: false
- featureFlagFill:
- description: >
- When disabled, this flag does not allow $fill, $locf or the linear interpolation window function
- to parse. It will be removed when PM-1935 is complete
- cpp_varname: gFlagFill
- default: false
-
featureFlagSortArray:
description: "Feature flag for allowing use of the $sortArray aggregation expression"
cpp_varname: gFeatureFlagSortArray
@@ -100,6 +93,18 @@ feature_flags:
cpp_varname: gFeatureFlagChangeStreamsVisibility
default: false
+ featureFlagLocf:
+ description: "Feature flag for allowing $locf window function"
+ cpp_varname: gFeatureFlagLocf
+ default: true
+ version: 5.2
+
+ featureFlagFill:
+ description: "Feature flag for allowing $fill and $linearFill window functions"
+ cpp_varname: gFeatureFlagFill
+ default: true
+ version: 5.3
+
featureFlagPerShardCursor:
description: "Feature flag for enabling a per-shard cursor via mongos"
cpp_varname: gFeatureFlagPerShardCursor