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

Query cache: "Cannot restart iteration of a cursor which issued a getMore"

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.2.0.rc1, 7.1.4, 7.0.10, 6.4.7
    • Affects Version/s: 7.0.5
    • Component/s: Query
    • None

      Version: Mongoid 7.0.5

      I enabled the query cache middleware in production and I'm seeing:

      Mongo::Error::InvalidCursorOperation
      Cannot restart iteration of a cursor which issued a getMore
      vendor/bundle/ruby/2.6.0/gems/mongo-2.13.0/lib/mongo/cursor.rb:152
       
      It appears that any attempt to use "getMore" fails with the query cache.
       
      Is this known behavior? Is it fixed in a newer version (7.1?)

      According to the docs:
       
      > Note that if the number of results is too large to be returned in a single batch, the QueryCache will not be used, even if Mongoid::QueryCache.enabled is true.
       
      This would imply to me that the query should still succeed, just without being cached...

            Assignee:
            emily.giurleo@mongodb.com Emily Giurleo (Inactive)
            Reporter:
            shields@tablecheck.com Johnny Shields
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: