[SERVER-75159] Write unit test which re-uses operation context to execute pipeline with $_internalJsEmit expression multiple times Created: 22/Mar/23  Updated: 18/Apr/23

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

Type: Task Priority: Major - P3
Reporter: Ben Shteinfeld Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: greenerbuild
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-74131 Multiplanning together with subplanni... Closed
Assigned Teams:
Query Optimization
Participants:
Linked BF Score: 104

 Description   

BF-27689 and BF-27079 are both caused by JsExecution being a decoration on the OperationContext, which can be re-used for multiple pipeline executions: in one case due to retries for StaleDbVersion exceptions, and in other case for subplanning in the multiplanner.

The error comes from the fact that the query code likely assumes that a single OperationContext will only ever be associated with a single pipeline and thus did not expect reuse with the same opCtx.

We should write a simple unit test which reuses the opCtx to execute two pipelines that use $_internalJsEmit to serve as a simple regression test for both of these BFs.


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