summaryrefslogtreecommitdiff
path: root/jstests/core/plan_cache_sbe.js
diff options
context:
space:
mode:
authorNikita Lapkov <nikita.lapkov@mongodb.com>2021-04-21 13:07:27 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-04-23 15:56:01 +0000
commit5f55799008fdcf7bd418f3dec1a4448c0801f701 (patch)
tree75c9b4a87b335ded06260eeabb023d44a2147d1f /jstests/core/plan_cache_sbe.js
parent913217ab00e3597bf763e40904cdd159e7e8cb2b (diff)
downloadmongo-5f55799008fdcf7bd418f3dec1a4448c0801f701.tar.gz
SERVER-56109 Replace repeated isSBEEnabled checks with helper function
Diffstat (limited to 'jstests/core/plan_cache_sbe.js')
-rw-r--r--jstests/core/plan_cache_sbe.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/jstests/core/plan_cache_sbe.js b/jstests/core/plan_cache_sbe.js
index 5c98603c6ec..3e3ff410606 100644
--- a/jstests/core/plan_cache_sbe.js
+++ b/jstests/core/plan_cache_sbe.js
@@ -16,16 +16,12 @@
(function() {
"use strict";
+load("jstests/libs/sbe_util.js"); // For checkSBEEnabled.
+
const coll = db.plan_cache_sbe;
coll.drop();
-// Note that the "getParameter" command is expected to fail in versions of mongod that do not yet
-// include the slot-based execution engine. When that happens, however, 'isSBEEnabled' still
-// correctly evaluates to false.
-const isSBEEnabled = (() => {
- const getParam = db.adminCommand({getParameter: 1, featureFlagSBE: 1});
- return getParam.hasOwnProperty("featureFlagSBE") && getParam.featureFlagSBE.value;
-})();
+const isSBEEnabled = checkSBEEnabled(db);
const isLegacyMode = db.getMongo().readMode() === "legacy";
// For legacy reads we always use the classic engine, even when SBE is turned on as a default
// engine.