PS-10098 Configurable Gap Lock Detection for MyRocks
https://perconadev.atlassian.net/browse/PS-10098
This patch implements a configurable gap_lock_raise_error system variable for MyRocks storage engine with three modes:
- OFF (default): Disables gap lock error detection
- WARNING: Issues warnings when gap locks would be used
- ERROR: Throws errors when gap locks would be used
The feature leverages MyRocks' snapshot isolation to maintain REPEATABLE READ semantics while providing a migration path from InnoDB's gap locking behavior. Includes test coverage for all modes.
Patch inspired from the original commit from Upstream.
The newest version from Meta is split into 2 commits: https://github.com/facebook/mysql-5.6/commit/26bc9f518c6 https://github.com/facebook/mysql-5.6/commit/d2c1430bcf7
@inikep thanks for finding these. Would Percona be interested in adopting these patches?
From usability perspective, gap_lock_raise_error is the most useful. For the file-related options, I have observed that using them is not as beneficial as returning the right error or warning to the user about the usage of Gap Locks. The ability to set it off is also useful when shadowing traffic to a MyRocks capable instance where the queries do not fail fatally with error but instead rely on Snapshot Isolation based MVCC.
Additionally the handling of warning in this port is less accommodating, in that it still returns a generic error but returns a specific warning. Maybe we can make the generic error go and away and solely generate the warning indicating usage of Gap Locks.
Any thoughts?