lock: blocking chains and DDL queue predecessors
Inspect lock waits, blocker trees, and DDL queue predecessors.
Find who holds locks, who is waiting in the queue, and whether a blocked DDL request is stalling downstream reads or writes. Read-only: never terminates holders or drops locks.
Usage
Key Options
| Option | Effect |
|---|---|
--tree | Render blocking hierarchy and highlight [DDL queue predecessor] nodes |
--table <name> | Filter displayed chains to one relation (resolved within current database) |
--lock-wait-warn <sec> | Wait duration threshold for WARN (default 10s) |
--limit <N> | Cap rendered waiter rows (0 unlimited); blocker edge lookup samples up to 50 global waiting PIDs |
Verdict & Reading Output
WARN(exit=1): Waiting lock duration>= --lock-wait-warn(default10s), including waits blocked by an uncommitted prepared transaction (2PC).UNKNOWN(exit=3): Non-monitoring users unable to read wait times seeUNKNOWN; probe collection caps blocker edge lookups at 50 waiting PIDs globally (--tableand<pid>filter display after collection without expanding the 50-PID global edge budget).- V8R6 vs V9: Versions lacking
sys_locks.waitstartestimate upper-bound waits as<=Ns (est.)fromstate_change.
Example (KES V9 Primary, --lock-wait-warn 1 --tree, COLUMNS=80)
Related Commands
kbdiag session— inspect the root holder PID’s transaction state and full SQLkbdiag txn— investigate2PCprepared transactions or long open blockerskbdiag progress— check whether an index build or vacuum is waiting on snapshots