Skip to content

storage/concurrency: prep lock-table for 20.1 release #44976

@nvb

Description

@nvb

Release 20.1 will contain a new approach to kv-level transaction locking. Instead of storing all locks inline in the MVCC keyspace and finding locks during request evaluation, locks will now be maintained in a separate lock-table. While replicated locks (intents) will not be pulled into a persistent lock-table keyspace during this release, the lock-table structure will track these locks, as well as unreplicated (best-effort) locks which enable SELECT FOR UPDATE (see #40205). Additionally, the lock-table structure will lead to significant improvements in transaction queuing. The lock-table's lock wait-queues will replace the current contentionQueue, leading to improved fairness between transactions and reduced latency now that the lock wait-queues react directly to intent resolution. For more on this change, see #41720.

The rest of this issue enumerates the remaining work items for the lock-table and storage/concurrency package that should get into this release. It does not include any work items that are specific to SELECT FOR UPDATE's use of the storage/concurrency package.

Must Have

Nice To Have

  • use txn priorities when ordering requests to avoid higher priority request waiting on a lower priority reservation holder @sumeerbhola
  • benchmark comparison between lazy waiting (current) and eager waiting in contended workloads @sumeerbhola
  • re-introduce invariant that reservation holder is always the request that acquires locks
  • distinguish in lockTableGuardImpl between waiting on lock holder and waiting on queued requests storage/concurrency: implement lockTableWaiter #44885
  • add visibility into state of lockTable through metrics and/or debug pages: kv/concurrency: expose lock table counters, introduce timeseries metrics #67350
  • simplify state transitions in acquireLock by not removing from lock holder's lockTableGuardImpl.mu.locks
  • eliminate waiting details except when waiting on lock holder, and do related code simplification @sumeerbhola

Feel free to modify. Please check off when changes merge.

Metadata

Metadata

Labels

A-kv-transactionsRelating to MVCC and the transactional model.T-kvKV Team

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions