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

dropping an index aborts other bg index builds

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 2.6.0
    • Component/s: Index Maintenance
    • None
    • ALL
    • Hide

      On a big collection foo with lots of records with an 'i' field:

      db.foo.ensureIndex( {x:1} );
      db.foo.ensureIndex( {i:1}, {background:true} );
      (then while the bg index build is running -- )
      db.foo.dropIndex("x_1")
      

      The bg index build aborts with:

      {
      	"createdCollectionAutomatically" : false,
      	"numIndexesBefore" : 2,
      	"ok" : 0,
      	"errmsg" : "cursor gone during bg index",
      	"code" : 43
      }
      
      Show
      On a big collection foo with lots of records with an 'i' field: db.foo.ensureIndex( {x:1} ); db.foo.ensureIndex( {i:1}, {background:true} ); (then while the bg index build is running -- ) db.foo.dropIndex("x_1") The bg index build aborts with: { "createdCollectionAutomatically" : false, "numIndexesBefore" : 2, "ok" : 0, "errmsg" : "cursor gone during bg index", "code" : 43 }

      If you drop one index while another index on the same collection is building in the background, it aborts the background index build. This is because we invalidate all cursors on a collection when we drop an index, not just the cursors affected by the drop.

      This can affect bg index builds on secondaries, since the concurrent timing of the index build and index drop can be different than on the original primary node.

            Assignee:
            milkie@mongodb.com Eric Milkie
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: