When batch is filled, check for isEOF before saving the cursor

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      If users have specified a batch size and the number of the documents in the final batch exactly matches the number of documents, returned by a cursor, we are left with a cursor that will return EOF next time it is called.

      An example of this happening would be if find command have a limit and an equal batchSize.

      Calling getNext() on a PlanExecutor can cause an unbounded amount of work to happen, so the suggested solution is to use PlanExecutor::isEOF() that should be O(1) check.

      Additionally, we need to ensure that PlanExecutorPipeline and PlanExecutorSBE::isEOF() return `true` if a limit has been reached.

            Assignee:
            Ivan Fefer
            Reporter:
            Ivan Fefer
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: