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

Failed to rebuild index in repair mode due to the yielding lock issue

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Storage Execution
    • ALL
    • Hide

      1. startup a standalone mongod ( my version is 6.0.9 )
      2. insert data and build index

      data=[]
      for(i=0;i<100000;i++)data.push({a:i})
      for(i=0;i<10;i++){db.test.insert(data);print(i)}
      db.test.createIndex({a:1})

      3. stop mongod, and remove a index file from database folder ( I remove the largest one )
      4. use repair mode to repair the database

      mongod --dbpath=... --repair

      5. mongod failed to repair, please check the output attached as repair.log

      A workaround is to set the internal parameter internalIndexBuildBulkLoadYieldIterations to a large number, e.g. 2147483647

      mongod --dbpath=... --repair --setParameter "internalIndexBuildBulkLoadYieldIterations=2147483647"
      Show
      1. startup a standalone mongod ( my version is 6.0.9 ) 2. insert data and build index data=[] for (i=0;i<100000;i++)data.push({a:i}) for (i=0;i<10;i++){db.test.insert(data);print(i)} db.test.createIndex({a:1}) 3. stop mongod, and remove a index file from database folder ( I remove the largest one ) 4. use repair mode to repair the database mongod --dbpath=... --repair 5. mongod failed to repair, please check the output attached as repair.log A workaround is to set the internal parameter internalIndexBuildBulkLoadYieldIterations to a large number, e.g. 2147483647 mongod --dbpath=... --repair --setParameter "internalIndexBuildBulkLoadYieldIterations=2147483647"

      When rebuilding indexes in repair mode, mongod reports an error and failed to finish the repairment

      The message is "Invariant failure","attr":{"expr":"!(_modeForTicket == MODE_S || _modeForTicket == MODE_X)","msg":"Yielding a strong global MODE_X/MODE_S lock is forbidden"

        1. repair.log
          40 kB
          mingtotti N/A

            Assignee:
            Unassigned Unassigned
            Reporter:
            mingtotti mingtotti N/A
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: