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

killCursors on pinned cursor may not do anything

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.7.3
    • None
    • Querying
    • None
    • Fully Compatible
    • ALL
    • Query 2018-02-12, Query 2018-02-26
    • 0

    Description

      If operation is running killCursors command while another is using the cursor, the killing operation will interrupt the operation using the cursor.

      However, if the operation using the cursor is towards the end of a getMore (for example, serializing the batch to be sent, like it does here), it may not check for interrupts. This means that it will not delete the cursor when it completes, and that future {{getMore}}s will succeed.

      To fix this, when a cursor is checked in (or unpinned) we should (under the cursor manager lock) check whether the operation was interrupted or not. If it was, we put the cursor into a special "killed" state so that the next attempt to check out the cursor results in an error (todo: discuss details more with Charlie. We could also just delete the cursor if this is super hard).

      To test this we may have to add another failpoint in getMore at the end of the function, at which point there won't be any more checks for interrupts.

      Attachments

        Activity

          People

            bernard.gorman@mongodb.com Bernard Gorman
            ian.boros@mongodb.com Ian Boros
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: