ExportXMLWordPrintableJSON

    • Storage Engines - Foundations
    • 844.997
    • SE Foundations - 2026-09-15
    • 5

      Problem:

      WT_SESSION::drop unlinks the dropped table's data file while holding the schema and table write locks. For a large file the unlink takes seconds and stalls every schema operation and data handle open on the connection (HELP-97809).

      Solution:

      • Under the lock, rename the file to a unique <file>.<btree_id>.wtdrop name; unlink it after the drop releases its locks, still inside the drop call.
      • Pending names are tracked per session, with space reserved before the metadata commits so the post-commit step cannot fail on allocation.
      • Cases that cannot rename (in-memory, live restore, no local file, rename failure) unlink in place as before.
      • Feature flag file_manager=(drop_defer_unlink), default true, reconfigurable, undocumented.
      • Statistics for pending and completed deferred removals; a timing stress flag for tests.

      A crash or failed unlink can leave a <file>.<btree_id>.wtdrop file behind; it is harmless.

      Out of scope: Cleanup of such files, background removal and the history store truncate are WT-18586.

            Assignee:
            Yury Ershov
            Reporter:
            Yury Ershov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: