Background index dropped before secondary completes isn't removed

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.5.5
    • Affects Version/s: 2.5.4
    • Component/s: Index Maintenance
    • Environment:
      tested on linux and osx with nightly build e7dce6441d29464a616565b946e0c7a78580f2cc
    • ALL
    • Hide

      jstest attached. Sometimes it works, very frustrating, but mostly it fails.

      Show
      jstest attached. Sometimes it works, very frustrating, but mostly it fails.
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Create a background indexing job, drop the index before the secondary finishes building it and it won't be deleted from the secondary. The secondary does receive the drop command:

      m31000| 2013-12-09T23:15:13.719+0000 [conn1] build index on: fgIndexSec.jstests_feh properties: { v: 1, key: { i: 1.0 }, name: "i_1", ns: "fgIndexSec.jstests_feh", background: true }
       m31000| 2013-12-09T23:15:14.057+0000 [conn1] build index done.  scanned 100000 total records. 0.338 secs
       m31000| 2013-12-09T23:15:14.057+0000 [conn1] command fgIndexSec.$cmd command: { insert: "system.indexes", documents: [ { _id: ObjectId('52a64f010da7f86215d22152'), ns: "fgIndexSec.jstests_feh", key: { i: 1.0 }, name: "i_1", background: true } ], ordered: true } keyUpdates:0  reslen:40 338ms
      

      Secondary starts index build:

       m31001| 2013-12-09T23:15:14.058+0000 [repl index builder 0] build index on: fgIndexSec.jstests_feh properties: { v: 1, key: { i: 1.0 }, name: "i_1", ns: "fgIndexSec.jstests_feh", background: true }
      

      system.indexes.find().forEach(printjson) on primary and secondary:

      {
      	"v" : 1,
      	"key" : {
      		"_id" : 1
      	},
      	"name" : "_id_",
      	"ns" : "fgIndexSec.jstests_feh"
      }
      {
      	"v" : 1,
      	"key" : {
      		"i" : 1
      	},
      	"name" : "i_1",
      	"ns" : "fgIndexSec.jstests_feh",
      	"background" : true
      }
      {
      	"v" : 1,
      	"key" : {
      		"_id" : 1
      	},
      	"name" : "_id_",
      	"ns" : "fgIndexSec.jstests_feh"
      }
      {
      	"v" : 1,
      	"key" : {
      		"i" : 1
      	},
      	"name" : "i_1",
      	"ns" : "fgIndexSec.jstests_feh",
      	"background" : true
      }
      

      At this point (from currentOp) the index build progress on the secondary is:

      "bg index build Background Index Build Progress: 1367/100000 1%"
      

      drop the index

       m31000| 2013-12-09T23:15:14.062+0000 [conn1] CMD: dropIndexes fgIndexSec.jstests_feh
      

      Secondary gets dropIndexes:

       m31001| 2013-12-09T23:15:14.065+0000 [repl writer worker 1] CMD: dropIndexes fgIndexSec.jstests_feh
      

      But after index build completes, doesn't drop:
      Primary:

      {
      	"v" : 1,
      	"key" : {
      		"_id" : 1
      	},
      	"name" : "_id_",
      	"ns" : "fgIndexSec.jstests_feh"
      }
      

      Secondary:

      {
      	"v" : 1,
      	"key" : {
      		"_id" : 1
      	},
      	"name" : "_id_",
      	"ns" : "fgIndexSec.jstests_feh"
      }
      {
      	"v" : 1,
      	"key" : {
      		"i" : 1
      	},
      	"name" : "i_1",
      	"ns" : "fgIndexSec.jstests_feh",
      	"background" : true
      }
      

            Assignee:
            Eric Milkie
            Reporter:
            Michael Grundy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: