Transactions, locks and binding reliability¶
See transaction visibility for v4.2.5 mode, snapshot and error boundaries.
Lock-service structure¶
CN LockService exposes local calls and can proxy a remote LockTable to the holder. Local tables maintain locks/waiters; TN LockTableAllocator manages service bindings/versions. First binding, node changes and reassignment follow actual state.
Execution and commit¶
Pessimistic plans insert lock operators before writes. UPDATE can become delete/insert with lock-path optimization. Optimistic MVCC/timestamp validation is not acquiring pessimistic locks at commit.
Commit validates bindings; a changed version can abort work to prevent commits with invalid lock ownership. Reconstructible CN caches do not remove session/transaction lifetimes.
Waiting, deadlocks and failures¶
Conflicts enter wait queues and distributed detection traverses dependencies. Unreachable holders, timeouts and busy detection differ. Victim selection is not an application guarantee. Separate whole-transaction errors from statement errors; reconcile unknown commits with final state/idempotency.
Retain transaction/lock-table/service IDs, versions, holders/waiters and error numbers. Separate lock waits from WAL. See two-session lab.