-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: DHandles
-
None
-
Storage Engines - Foundations
-
860.187
-
None
-
None
Reopening an idle table requires disk I/O while holding the global schema lock exclusively, which blocks all other threads trying to open cursors. This change converts the schema lock into a read/write lock and takes it in shared mode during the open and reopen paths. Threads can now reopen different tables in parallel without waiting on a single I/O operation.
The dhandle sweep closes idle tables. The next access reopens the table and performs disk I/O (block-manager open, reading the checkpoint and root page) under an exclusive global schema lock. On a connection with ~200K tables and a rotating working set, reopens happen often. Even when table creation is near zero, every thread that needs the schema lock to open a cursor waits behind that single I/O.
Proposed fix: make the schema lock a read/write lock. The open and reopen path takes the lock in shared mode, allowing reopens of different tables to run in parallel. Operations that change connection-level schema state still take the lock exclusively: create, drop, verify, alter, rename, truncate, salvage, compact, backup, rollback to stable, recovery, checkpoint prepare, and disaggregated-storage publish. The per-dhandle WT_DHANDLE_EXCLUSIVE flag is independent of the schema lock and continues to serialize same-uri races, making the shared path safe. The disaggregated open path keeps the exclusive lock.
- is related to
-
WT-18953 Narrow the schema-locked section of the disaggregated checkpoint pickup
-
- Open
-
-
WT-18929 Let the disaggregated open path take a shared schema lock on reopen
-
- Backlog
-
-
WT-19026 Snapshot creation spins without yielding while another session gets a transaction ID
-
- In Code Review
-
- related to
-
WT-15098 Reduce the effect of the schema lock during WT_SESSION::create on high dhandle workloads
-
- Open
-
-
WT-19026 Snapshot creation spins without yielding while another session gets a transaction ID
-
- In Code Review
-
-
WT-19176 WT_RWLOCK write unlock wakes all waiting writers
-
- Investigating
-