-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Execution
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.
- https://github.com/mongodb/mongo/blob/cd749a77bd02a20a3268a41caf52f994da0bb959/jstests/concurrency/fsm_workloads/explain_remove.js#L39-L40
- https://github.com/mongodb/mongo/blob/cd749a77bd02a20a3268a41caf52f994da0bb959/jstests/concurrency/fsm_workloads/explain_update.js#L67-L68
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.