[MDEV-11735] MyRocks: Gap Lock detector support Created: 2017-01-06  Updated: 2018-03-20  Resolved: 2018-03-20

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - RocksDB
Affects Version/s: N/A
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Sergei Petrunia Assignee: Sergei Petrunia
Resolution: Won't Do Votes: 0
Labels: None

Issue Links:
PartOf
is part of MDEV-9658 Make MyRocks in MariaDB stable Closed

 Description   

InnoDB does "Gap Locking", while MyRocks doesn't. This causes different transaction isolation behavior between the two engines.

In order to simplify migration, MyRocks team has added an SQL layer feature that

  • detects queries that are doing gap locks
  • optionally writes these queries into log
  • optionally aborts these queries (TODO: more details)

The idea is that before the migration, one can run with InnoDB, and enable these to check if the queries are using Gap Locks, and if so, rewrite them to not do that.

Relevant commits:
9b439ee Add option to exclude tables from gap lock check
6078c85 Preventing to write "Got error 122.." to err log on Gap Lock errors
782cc5a Optionally block/log queries relying on Gap Locks

There is no agreement about whether this can be ported to MariaDB.

  • Pro: FB team found this feature very useful when moving applications to MyRocks
  • Contra: It's a storage-engine specific feature, why is it present on the SQL layer?

Generated at Thu Feb 08 07:52:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.