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

Make sure PlanExecutor is saved when leaving DocumentSourceCursor::loadBatch()

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.13
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Repl 2017-08-21, Repl 2017-09-11
    • 0

      An exception can be thrown during a call to PlanExecutor::getNext() if the operation times out. When this happens, we can leave DocumentSourceCursor::loadBatch() without saving state on the PlanExecutor. Normally this wouldn't be a problem, since the whole Pipeline is about to be destroyed and we will never use it again. However, now that we've introduced tailable aggregation cursors as part of the work for change streams, it's possible that we will continue using the pipeline after timing out. (There is logic in the getMore command to ignore this particular error condition for tailable cursors)

      There are a couple approaches we could take to resolve this, two come to mind:

      • Change PlanExecutor to swallow this error if it's tailable, and just return EOF instead.
      • Change DocumentSourceCursor to extend it's ON_BLOCK_EXIT to make sure to save the state of the PlanExecutor.

            Assignee:
            charlie.swanson@mongodb.com Charlie Swanson
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: