Jun 2026
CUBRID Lock Manager
Multi-Granularity Locking, Conversion, Deadlock Detection
How the textbook 2PL and multi-granularity locking get realized on top of CUBRID's OID-shaped objects — now extended to the code level with the detail analysis doc. Walks through the core data structures (LK_ENTRY, LK_RES, LK_TRAN_LOCK, the aggregate-mode cache), boot and the three-tier memory/lockfree boundary, the 12-mode compatibility matrix, the seven acquisition paths (A–G) inside lock_internal_perform_lock_object, conversion with the Upgrader Positioning Rule and the releaser-driven grant cascade, the release path scoped by MVCC-disabled class set and isolation level (with the NON2PL shadow protocol), conditional lock escalation, suspend/resume wake states, the waits-for-graph detector with its six-criteria victim selection, and the special paths (instant probe, composite lock, hint/demote/subclass).