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

dbStats command can fail if an index is bulk loading

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: Catalog
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Hide

      1. Add a pause to the WiredTigerIndex::BulkBuilder::openBulkCursor after a cursor has been successfully opened.
      2. Run mongod and build an index; observe the index build hanging.
      3. In another connected shell, attempt to run dbStats on the db containing the collection with the index being built. Result:

      > db.runCommand({dbStats:1})
      {
      	"ok" : 0,
      	"errmsg" : "unable to open cursor at URI statistics:table:index-0-4936792770501023666. reason: Device or resource busy",
      	"code" : 43,
      	"codeName" : "CursorNotFound"
      }
      
      Show
      1. Add a pause to the WiredTigerIndex::BulkBuilder::openBulkCursor after a cursor has been successfully opened. 2. Run mongod and build an index; observe the index build hanging. 3. In another connected shell, attempt to run dbStats on the db containing the collection with the index being built. Result: > db.runCommand({dbStats:1}) { "ok" : 0, "errmsg" : "unable to open cursor at URI statistics:table:index-0-4936792770501023666. reason: Device or resource busy", "code" : 43, "codeName" : "CursorNotFound" }
    • Execution Team 2021-08-23

      Part of the dbStats command is to collect index sizes, which attempts to open a statistics cursor on every index table. This can fail if an index table happens to be locked with a bulk-index-load cursor.

      Note that we should probably audit all places that iterate through indexes like this and ensure all of them are prepared for such an error to be returned from a statistics cursor (simply skipping over such indexes sounds reasonable).

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: