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

Implement support for getMore against a mongot cursor created with a user-defined limit

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0, 6.0.7, 7.0.0-rc3, 5.0.20
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • v7.0, v6.0, v5.0, v4.4
    • QO 2023-05-15, QO 2023-05-29

      The first batch from mongot may not contain the full set of results for the following cases:

      1. A document may be filtered out by the $idLookup stage
      2. 16MB batch size limit (more likely with storedSource, since normally mongot only returns _id and a score)

      For these cases, mongod should not need to request the full limit for the subsequent getMore. Instead, we could build a method for only requesting (limit - N) results, where N is the number of documents which made it past the $idLookup stage. The actual approach will be left up to the implementation.

      Note that for storedSource queries, there is no $idLookup stage so the solution should not be tied to the presence of it. Also there is no guarantee that one of the cases above does not happen again for the subsequent getMore, so the solution should be generic and handle this. 

            Assignee:
            militsa.sotirova@mongodb.com Militsa Sotirova
            Reporter:
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: