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

Cursor not found error when running long query on secondary with noCursorTimeout

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6.3
    • Component/s: Querying
    • Labels:
    • ALL
    • Sharding 2018-05-21

      I’ve had two Ruby tickets reporting that a user gets a cursor id not found error with the latest version of the server and the Ruby driver. I’ve been able to reproduce it (see below for code and logs).

      Here are the details:

      • The query is done with read preference secondaryPreferred
      • The query has noCursorTimeout set to true
      • The query uses an implicit session
      • The sequence of operations is: find (success), getmore (success), getmore (failure/no cursor id found)
      • As the user iterates over the query results, there is sometimes a few minutes between getMore requests. This value has been 7 minutes and 10 minutes.

      I confirmed that:

      • The driver is indeed setting noCursorTimeout on the query
      • The same lsid is being used for the original find and following getMores
      • Neither the cursor nor the session are being prematurely ended before the getMore failure. (no endSessions commands or killCursors commands found in the logs)

      I can provide the user's primary and secondary logs, as well as application logs.

      Here are the Ruby tickets: RUBY-1312, RUBY-1318

      I was able to reproduce this with the following Ruby code:
      https://gist.github.com/estolfo/f6a46b68fdf3db9be102ba2236e7abd5

      This is the driver log:
      https://gist.github.com/estolfo/1bc93c544e25b71678d9389a306f5292

            Assignee:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Reporter:
            emily.stolfo Emily Stolfo
            Votes:
            3 Vote for this issue
            Watchers:
            25 Start watching this issue

              Created:
              Updated:
              Resolved: