[SERVER-60389] [SBE] Rewrite engine specific assertions to be multiversion compatible Created: 01/Oct/21  Updated: 29/Oct/23  Resolved: 12/Oct/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.2.0, 5.1.0-rc1

Type: Task Priority: Major - P3
Reporter: Jennifer Peshansky (Inactive) Assignee: Mihai Andrei
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.1
Sprint: QE 2021-10-04, QE 2021-10-18
Participants:
Linked BF Score: 66

 Description   

Currently, the checkSBEEnabled function first assumes SBE is on, and then checks if there is a property internalQueryForceClassicEngine and if it is true, and if so, returns that SBE is off. However, the internalQueryForceClassicEngine setParameter didn't exist prior to 5.1, so in multiversion testing, SBE is incorrectly returned as on when it shouldn't be.

In order to remedy this, we can flip the sense of the check. The checkResult flag should really be called isSBEEnabled for more clarity, be initialized to false, and then the check for each node can be:
isSbeEnabled = getParam.hasOwnProperty("internalQueryForceClassicEngine") && !getParam.internalQueryForceClassicEngine;
With this change, SBE will be off by default in the versions where the internalQueryForceClassicEngine flag doesn't exist, and will be checked as normal in versions where it does exist.

We may also want to consider adding a secondary check in the case that internalQueryForceClassicEngine doesn't exist:
isSbeEnabled = getParam.hasOwnProperty("internalQueryEnableSlotBasedExecutionEngine") && getParam.internalQueryEnableSlotBasedExecutionEngine;
This was the old flag before internalQueryForceClassicEngine was added, and this could help us still test SBE in versions before we changed the flag.



 Comments   
Comment by Githook User [ 12/Oct/21 ]

Author:

{'name': 'Mihai Andrei', 'email': 'mihai.andrei@10gen.com', 'username': 'mtandrei'}

Message: SERVER-60389 [SBE] Rewrite engine specific assertions to be multiversion compatible

Co-authored-by Mickey. J Winters <mickey.winters@mongodb.com>
Branch: v5.1
https://github.com/mongodb/mongo/commit/319f25daaa269cf979b9c40f80a9192a86c12d73

Comment by Githook User [ 12/Oct/21 ]

Author:

{'name': 'Mihai Andrei', 'email': 'mihai.andrei@10gen.com', 'username': 'mtandrei'}

Message: SERVER-60389 [SBE] Rewrite engine specific assertions to be multiversion compatible

Co-authored-by Mickey. J Winters <mickey.winters@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/52174ffab806e33d77ccb255ddc0d6c8023acc8d

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