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

Crash during collection compaction can drop indexes it intended to recreate.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: MMAPv1, Storage
    • Labels:
      None
    • Operating System:
      ALL
    • Linked BF Score:
      65

      Description

      The index drop is performed in a separate WriteUnitOfWork than their recreation on the catalog (part of `MultiIndexBlock::init`):
      https://github.com/mongodb/mongo/blob/5767ee2421fa6c7934a90e9083f07743a83dcf71/src/mongo/db/catalog/collection_compact.cpp#L179-L188

      Note how repairDatabase's index rebuild avoids this problem: https://github.com/mongodb/mongo/blob/5767ee2421fa6c7934a90e9083f07743a83dcf71/src/mongo/db/repair_database.cpp#L146-L150

      It may be reasonable to have compact re-use the repairDatabase code for this.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: