-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
sig/transactionSIG:TransactionSIG:Transactiontype/feature-requestCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.
Description
Feature Request
Is your feature request related to a problem? Please describe:
TiDB does not support Shared Lock. If we enable the compatibility by tidb_enable_noop_functions, TiDB can ignore the shared lock.
To make the for share
statements acquire pessimistic locks as needed, a new mechanism is needed.
Describe the feature you'd like:
Introduce a new variable tidb_enable_shared_lock_upgrade
to control whether the for share
should acquire locks as the for update
does.
tidb_enable_shared_lock_promotion
- Scope: GLOBAL | SESSION
- Persists to cluster: Yes
- Type: Boolean
- Default value: false
- Value options: true, false
- This variable indicate whether TiDB promotes Shared Lock to Exclusive Lock. When you set the variable to true, the statements SELECT ... FOR SHARE and SELECT ... LOCK IN SHARE MODE will be processed as SELECT ... FOR UPDATE.
When it's enabled
Describe alternatives you've considered:
Implement the complete for share
feature, it's quite complex and resource consuming.
Teachability, Documentation, Adoption, Migration Strategy:
Metadata
Metadata
Assignees
Labels
sig/transactionSIG:TransactionSIG:Transactiontype/feature-requestCategorizes issue or PR as related to a new feature.Categorizes issue or PR as related to a new feature.