Investigate if we can stop holding database and collection locks during compaction

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Storage Engines, Storage Engines - Server Integration
    • SESI - 2025-09-30
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      There have been a couple of cases where compact interacted poorly with chunk migrations because compact holds an IX lock for a long time, and chunk migrations try to take an S/X lock when committing.

      Realistically, we don't need to hold any collection lock during compaction. If another operation tries to drop the table, it'll just get EBUSY because exclusive access isn't possible. We can even do better. WiredTiger regularly calls back to the server to determine if the compaction should be stopped, if the server operation gets interrupted. We can hook into that mechanism so compaction ends early if a drop is pending, since continuing the work would just be wasted effort anyway.

              Assignee:
              Unassigned
              Reporter:
              Gregory Wlodarek
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated: