Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-2773

Verify query cache behavior with concurrent iterations of the same cursor

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.19.0
    • Affects Version/s: None
    • Component/s: None
    • None

      I believe we do not have test coverage for the following scenario:

      • A query is issued and is partially iterated (partial iteration of first batch only, or first batch iterated fully but result set not exhausted)
      • The query is issued again and the first query's cursor is returned to the second caller
      • Second caller iterates the cursor further than the first caller has gotten
      • The first caller continues its iteration

      Since iteration mutates the cursor (by writing into the cached documents), this could produce duplicate/skipped documents conceivably.

      This ticket should also include user documentation for how query cache works with partial result set iteration. Until the above scenario is tested, documentation that states that partially iterated cursors are cached (which they currently are) may mislead users into relying on this functionality when it doesn't work in the event of concurrent iteration.

            Assignee:
            neil.shweky@mongodb.com Neil Shweky (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: