summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Swanson <charlie.swanson@mongodb.com>2021-10-05 01:49:50 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-09 01:42:22 +0000
commitc540a205558830d6a2ec7147a004516f741b6e23 (patch)
treee89d395a13c64d48c44f57dd0031138ad5287717
parentf92e0d318ab17f730c49ffdb79f1a64d43fbabd3 (diff)
downloadmongo-c540a205558830d6a2ec7147a004516f741b6e23.tar.gz
SERVER-60520 Allow $searchMeta by default
Default the 'enableSearchMeta' parameter to true
-rw-r--r--jstests/aggregation/documents.js3
-rw-r--r--jstests/aggregation/variables/search_meta.js3
-rw-r--r--src/mongo/db/pipeline/document_source_union_with.cpp4
-rw-r--r--src/mongo/db/query/query_knobs.idl2
4 files changed, 4 insertions, 8 deletions
diff --git a/jstests/aggregation/documents.js b/jstests/aggregation/documents.js
index 5996b5dd4ff..deffe8fcf15 100644
--- a/jstests/aggregation/documents.js
+++ b/jstests/aggregation/documents.js
@@ -15,15 +15,12 @@
(function() {
"use strict";
-load('jstests/libs/fixture_helpers.js'); // for runCommandOnEachPrimary.
const writeConcernOptions = {
writeConcern: {w: "majority"}
};
const currDB = db;
-FixtureHelpers.runCommandOnEachPrimary(
- {db: db.getSiblingDB("admin"), cmdObj: {setParameter: 1, enableSearchMeta: true}});
const coll = currDB.documents;
coll.drop(writeConcernOptions);
coll.insert({a: 1}, writeConcernOptions);
diff --git a/jstests/aggregation/variables/search_meta.js b/jstests/aggregation/variables/search_meta.js
index 5a29598b6bc..b1e5ee71a1f 100644
--- a/jstests/aggregation/variables/search_meta.js
+++ b/jstests/aggregation/variables/search_meta.js
@@ -10,9 +10,6 @@
*/
(function() {
"use strict";
-load('jstests/libs/fixture_helpers.js'); // for runCommandOnEachPrimary.
-FixtureHelpers.runCommandOnEachPrimary(
- {db: db.getSiblingDB("admin"), cmdObj: {setParameter: 1, enableSearchMeta: true}});
const coll = db.searchCollector;
coll.drop();
diff --git a/src/mongo/db/pipeline/document_source_union_with.cpp b/src/mongo/db/pipeline/document_source_union_with.cpp
index 05f388ff87a..d54e95b8425 100644
--- a/src/mongo/db/pipeline/document_source_union_with.cpp
+++ b/src/mongo/db/pipeline/document_source_union_with.cpp
@@ -211,7 +211,9 @@ DocumentSource::GetNextResult DocumentSourceUnionWith::doGetNext() {
logStartingSubPipeline(serializedPipe);
// $$SEARCH_META can be set during runtime earlier in the pipeline, and therefore must be
// copied to the subpipeline manually.
- if (enableSearchMeta.load()) {
+ if (serverGlobalParams.featureCompatibility.getVersion() >=
+ ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44 &&
+ enableSearchMeta.load()) {
auto metaVal = pExpCtx->variables.getValue(Variables::kSearchMetaId, Document());
if (!metaVal.missing()) {
_pipeline->getContext()->variables.setReservedValue(
diff --git a/src/mongo/db/query/query_knobs.idl b/src/mongo/db/query/query_knobs.idl
index d68433340a0..7eaba46f916 100644
--- a/src/mongo/db/query/query_knobs.idl
+++ b/src/mongo/db/query/query_knobs.idl
@@ -421,7 +421,7 @@ server_parameters:
set_at: [ startup, runtime ]
cpp_varname: "enableSearchMeta"
cpp_vartype: AtomicWord<bool>
- default: false
+ default: true
enableTimeoutOfInactiveSessionCursors:
description: "If true, cursors opened within sessions are eligible for inactive cursor timeout."