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

mongod crash during index build leaves orphaned index

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.5
    • Component/s: Index Maintenance
    • None
    • ALL
    • Hide

      Index was built in the background and presumably worked before?

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

      [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.

            Assignee:
            rassi J Rassi
            Reporter:
            parkan Arkadiy Kukarkin
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: