$_internalConvertBucketIndexStats may crash the mongod server when working on no timeseries input
MongoDB Server
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| MongoDB MongoDB Server |
| No fix yet |
Original description
The $_internalConvertBucketIndexStats stage used PauseExecution as a way to signal "skip this document" when an index stats conversion failed. But PauseExecution is not a general purpose skip mechanism, but rather a TeeBuffer-internal signal used solely by $facet to coordinate its sub-pipelines. When this stage is placed before $facet in a pipeline, TeeBuffer receives the unexpected PauseExecution from upstream and hits a hard invariant assertion, crashing mongod.