Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-98069

$facet with $bucketAuto with custom accumulators can tassert or return incorrect results

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      If a pipeline contains a $facet with a $bucketAuto stage that contains one of the custom accumulators, we can hit a tassert or return incorrect results (depending on the accumulator). Repro is linked in comments.

      This only happens if the $internalFacetTeeConsumer stage returns a paused GetNextResult, which it does not always do (and if this comment isn't stale, I think this is the only time where we might get a paused GetNextResult). This is problematic because the function that generates the position keys resets its counter every time it is called (and if there is a paused result, we will call the function again once we resume). Maybe a quick fix would be to not reset that positional counter, but I'm not sure if there are other implications for that.

            Assignee:
            rui.liu@mongodb.com Rui Liu
            Reporter:
            militsa.sotirova@mongodb.com Militsa Sotirova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: