diff options
author | Nikita Lapkov <nikita.lapkov@mongodb.com> | 2021-04-21 13:07:27 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-04-23 15:56:01 +0000 |
commit | 5f55799008fdcf7bd418f3dec1a4448c0801f701 (patch) | |
tree | 75c9b4a87b335ded06260eeabb023d44a2147d1f /jstests/core/plan_cache_sbe.js | |
parent | 913217ab00e3597bf763e40904cdd159e7e8cb2b (diff) | |
download | mongo-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.js | 10 |
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. |