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

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

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: MMAPv1, Storage
    • None
    • Storage Execution
    • ALL
    • 65

      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.

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            daniel.gottlieb@mongodb.com Daniel Gottlieb (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: