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

Drop can fail because it is run in a session with cached cursors

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0-rc0
    • Component/s: Storage
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Storage 2017-08-21, Storage 2017-09-11, Storage 2017-10-02

      Description

      While testing a simple workload that creates and drops collections in a tight loop (see below), I noticed that many drop operations could not be completed immediately and instead were queued and retried later.

      Since the queuing and retrying is expensive, I looked into what was causing the drops to fail the first time and noticed that there could be cursors active in the session used for the drop operation that were not being closed before attempting the drop.

      Test:

      collections=100000
       
      mongo --eval "
      for (var i=0; i<$collections; i++) {
          c = db['c' + i]
          c.insert({a:i, b:i, c:i})
          c.drop()
      }
      "
      

      The fix is to call closeAllCursors(uri) on the enclosing session.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: