-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Schema Management
-
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.
- is related to
-
WT-18386 Make table drop metadata changes atomic with table TRIM
-
- Open
-
- related to
-
WT-11921 Investigate inefficient interaction between drop table and sweep sever
-
- Open
-
-
WT-18581 Investigate opportunities for table drop to never return EBUSY
-
- Backlog
-
-
WT-18586 Defer a dropped table's file unlink and history store truncate to the sweep server
-
- In Progress
-
-
WT-18427 Non-forced drop discards the tree from cache synchronously while holding the schema and dhandle-list write locks
-
- Closed
-
-
WT-13812
Investigate table locking during session->drop
-
- Backlog
-