[SERVER-82014] Decide and act on value of explain_remove.js and explain_update.js FSM workloads Created: 09/Oct/23  Updated: 30/Jan/24

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Max Hirschhorn Assignee: Backlog - Query Execution
Resolution: Unresolved Votes: 0
Labels: greenerbuild, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Participants:

 Description   

The explain_remove.js and explain_update.js FSM workloads have existed for a while (SERVER-16648, MongoDB 3.2) yet haven't actually been running the explain command for the delete and update commands as intended. This can be observed most recently with eslint-disable-line being applied to ignore the undefined explain variable referenced in the explainMultiRemove() and explainBasicUpdate() $config.state functions.

The reason the undefined explain variable hasn't led to a JavaScript error in testing is because the definition for $config.transitions doesn't include the newly defined $config.state functions to be included in the transition table and so these functions are never called. This is because Object.extend() overwrites the "explain" property with the $super.transitions definition despite the extended FSM workloads intending to preserve the existing transition table except for the "explain" property.

What was likely intended is reversing the order of the arguments and using Object.merge() to combine the objects instead:

$config.transitions = Object.merge(
    $super.transitions, {explain: $config.data.assignEqualProbsToTransitions($config.states)});

Given these FSM workloads have never been running as intended and we almost surely have coverage elsewhere, it may also be considered acceptable to delete these JavaScript files entirely rather than fix them.


Generated at Thu Feb 08 06:47:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.