cockroachdb / cockroachdb/cockroach
kv: Implement predicate locks
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
Implement an API to lock predicates, even when corresponding rows do not exist.
In order to properly implement UNIQUE WITHOUT INDEX (#110873) under READ COMMITTED isolation, the SQL layer needs the ability to lock predicates, even when there is no corresponding row. For UNIQUE and PRIMARY constraints on PARTITION ALL BY and REGIONAL BY ROW relations, we can get away with the CPut of a tombstone into all partitions of relevant index, but no such index exists for UNIQUE WITHOUT INDEX.
Additionally, if we ever want SELECT FOR UPDATE to block phantom inserts (#120673), we will also need this feature.
Jira issue: CRDB-39989
Contributor guide
Assessment
This issue has not been assessed yet.