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

ClientCursorPin doesn't properly track number of open pinned cursors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.5.1
    • Fix Version/s: 3.5.3
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Query 2017-02-13

      Description

      The changes introduced in SERVER-27065 made it possible to move-construct or move-assign into a ClientCursorPin, which left an old ClientCursorPin object around which no longer corresponds to an actual pinned cursor, since ownership was transferred during the move. Nonetheless, when the old ClientCursorPin goes out of scope, it will decrement the number of pinned cursors, one more time than necessary. This happens during a getMore, so can be shown using serverStatus:

      > db.foo.find()
      { "_id" : ObjectId("58813b945c612bc58ce4c0e3"), "x" : 1 }
      { "_id" : ObjectId("588b6e69bf0c887f6da894b4"), "x" : 1 }
      > db.serverStatus().metrics.cursor
      {
      	"timedOut" : NumberLong(0),
      	"open" : {
      		"noTimeout" : NumberLong(0),
      		"pinned" : NumberLong(0),
      		"total" : NumberLong(0)
      	}
      }
      > db.foo.find().batchSize(1)
      { "_id" : ObjectId("58813b945c612bc58ce4c0e3"), "x" : 1 }
      { "_id" : ObjectId("588b6e69bf0c887f6da894b4"), "x" : 1 }
      > db.serverStatus().metrics.cursor
      {
      	"timedOut" : NumberLong(0),
      	"open" : {
      		"noTimeout" : NumberLong(0),
      		"pinned" : NumberLong(-2),
      		"total" : NumberLong(0)
      	}
      }
      

        Attachments

          Activity

            People

            Assignee:
            david.storch David Storch
            Reporter:
            charlie.swanson Charlie Swanson
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: