Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-4820

QueryCache raise on recalled getMore queries

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • 7.0.4, 7.0.5
    • None
    • Query
    • None

    Description

      Hello,

      First, I don’t really know since which version the issue occurs; but on a Rails project (Prod env) we have the issue with the previous version (7.0.4) but with a different error message.

      So, when `Mongoid::QueryCache` is `enabled`, all requests with a response larger than the `batch_size` cannot be called twice, even without one explicitly set.
      When calling it twice, it raises a `NotImplementedError: Cannot restart iteration of a cursor which issued a getMore`.
      I also tried with several older combo versions of Mongoid and Mongo driver and it raises: `Mongo::Error::OperationFailure (Cursor not found, cursor id: 140000000000 (40))`.
      I've seen in the source code that `Mongoid::QueryCache` is supposed to handle requests using `getMore` with a patch on the mongo driver. The problem is that it isn’t working as expected. The `process` method looks correctly overrided but I didn’t go deeper.

      To ensure this issue can be reproduced, I have created a minimal project: guille-moe/mongoid-query-cache-test
      A typical example with the issue can be found here: guille-moe/mongoid-query-cache-test/spec/models/user_spec.rb

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pro@guille.moe Paul Guillemot
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: