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

background ensureIndex blocks too many operations with WiredTiger

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.8.0-rc4
    • Component/s: Storage, WiredTiger
    • Fully Compatible
    • ALL
    • Hide

      1) Create a large collection (I used iibench-mongodb)
      2) drop all secondary indexes it uses
      3) Run: db.purchases_index.ensureIndex(

      {"price":1, "customerid":1}

      ,

      {"background":true}

      )
      4) in another shell run the commands "show collections" and "db.purchases_index.getIndexes()

      The problem does not reproduce with mmapv1.
      The problem was produced with the WT btree

      Show
      1) Create a large collection (I used iibench-mongodb) 2) drop all secondary indexes it uses 3) Run: db.purchases_index.ensureIndex( {"price":1, "customerid":1} , {"background":true} ) 4) in another shell run the commands "show collections" and "db.purchases_index.getIndexes() The problem does not reproduce with mmapv1. The problem was produced with the WT btree

      The docs state that ensureIndex(..,

      {"background":false}

      ) don't block all operations on a database but that is not the case for WiredTiger.With a long-running background index creation in progress on "purchases_index" the following commands have been blocked for me:

      • show collections -> for the database that contains purchases_index
      • db.purchases_index.getIndexes()
      • db.pi.insert( {"foo":1}

        ) --> "pi" did not exist prior to this insert

            Assignee:
            ramon.fernandez@mongodb.com Ramon Fernandez Marina
            Reporter:
            mdcallag Mark Callaghan
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: