-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Integration
-
None
-
3
-
TBD
-
None
-
None
-
None
-
None
-
None
-
None
We currently prevent translations from happening multiple times by checking the rawData flag. However, rawData is wrong for subpipelines and is specific to timeseries. We set rawData to be true in the top-level pipeline when we prepend the unpack stage. rawData is a decoration on the operation context, and subpipelines share the same operation context as the original pipeline. So when we look to prepend the unpack stage in the subpipeline, we see that rawData is true and do not prepend the unpack stage.
We should remove the use of the rawData flag to prevent pipeline translations from happening twice. We will add a new member variable to the Pipeline class: _translatedWithInternalStages. This member variable will start as false and we will set it to true after we call performPreOptimizationRewrites() in the shard or on the router.
If the translation happens on the router, we will set an internal field _translatedWithInternalStages to true in the aggregate command that is sent to the shards. This way, the router can indicate to the shards that the pipeline is already translated. Therefore, we will only translate pipelines if _translatedWithInternalStages and rawData are both false.
- is duplicated by
-
SERVER-106012 Add flag to prevent timeseries rewrites from happening twice
-
- Closed
-
- related to
-
SERVER-106879 Reset rawData on opCtx before retring operation on router
-
- In Code Review
-