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

mongod crash during index build leaves orphaned index

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 2.4.5
    • Fix Version/s: None
    • Component/s: Indexing
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Index was built in the background and presumably worked before?

      Show
      Index was built in the background and presumably worked before?

      Description

      [ed: original title was "Index shown in getIndexes() does not actually exist"]

      I've been trying to track down a mysterious performance issue on one of our shards for a little while, and it turns out the culprit is an index that doesn't actually exist:

      events2:PRIMARY> db.listen.getIndexes();
      [
              {
                      "v" : 1,
                      "key" : {
                              "_id" : 1
                      },
                      "ns" : "site_events.listen",
                      "name" : "_id_"
              },
              {
                      "v" : 1,
                      "key" : {
                              "uid" : 1
                      },
                      "ns" : "site_events.listen",
                      "name" : "uid_1"
              },
              {
                      "v" : 1,
                      "key" : {
                              "list.i" : 1 // list.i, okay
                      },
                      "ns" : "site_events.listen",
                      "name" : "list.i_1",
                      "background" : true
              }
      ]
      events2:PRIMARY>

      events2:PRIMARY> db.listen.stats();
      {
              "ns" : "site_events.listen",
              "count" : 616369,
              "size" : 7789669296,
              "avgObjSize" : 12637.996550767479,
              "storageSize" : 9305386992,
              "numExtents" : 24,
              "nindexes" : 2,
              "lastExtentSize" : 2146426864,
              "paddingFactor" : 1.0000000000920757,
              "systemFlags" : 1,
              "userFlags" : 1,
              "totalIndexSize" : 45098816,
              "indexSizes" : { // no list.i here!
                      "_id_" : 22026144,
                      "uid_1" : 23072672
              },
              "ok" : 1
      }

      Queries that should use this index do a full scan instead.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: