[SERVER-56109] [SBE] Replace isSBEEnabled checked with a helper function Created: 15/Apr/21  Updated: 29/Oct/23  Resolved: 23/Apr/21

Status: Closed
Project: Core Server
Component/s: Query Execution
Affects Version/s: None
Fix Version/s: 5.0.0-rc0

Type: Task Priority: Major - P3
Reporter: Anton Korshunov Assignee: Nikita Lapkov (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query Execution 2021-05-03
Participants:

 Description   

Currently we use the following patten in jstests when we need to figure out if we're in SBE mode or not:

const isSBEEnabled = (() => {
    const getParam = db.adminCommand({getParameter: 1, featureFlagSBE: 1});
    return getParam.hasOwnProperty("featureFlagSBE") && getParam.featureFlagSBE.value;
})();

We should replace this boilerplate code with a helper function instead.

Also, as ian.boros pointed out, this check wouldn't work in a sharded cluster in certain configurations. Namely, when db is using a connection to mongos which doesn't have the feature flag enabled.



 Comments   
Comment by Githook User [ 23/Apr/21 ]

Author:

{'name': 'Nikita Lapkov', 'email': 'nikita.lapkov@mongodb.com', 'username': 'laplab'}

Message: SERVER-56109 Replace repeated isSBEEnabled checks with helper function
Branch: master
https://github.com/mongodb/mongo/commit/5f55799008fdcf7bd418f3dec1a4448c0801f701

Comment by Anton Korshunov [ 21/Apr/21 ]

ian.boros created a helper function checkSBEEnabled in SERVER-55623, so we just need to replace all occurrences of the boilerplate code above with this function.

Generated at Thu Feb 08 05:38:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.