[Commits] 34a0cf718aa: Range locking fixes

psergey sergey at mariadb.com
Sun Nov 24 19:01:53 EET 2019


revision-id: 34a0cf718aa19d5bda2d471b2c6e20dac8256989 (fb-prod201903-257-g34a0cf718aa)
parent(s): 30c4f566dca5d8a8bec2969faa7132c746afad92
author: Sergei Petrunia
committer: Sergei Petrunia
timestamp: 2019-11-24 20:01:53 +0300
message:

Range locking fixes

- Update RocksDB to revision that prints the locks in STO-mode, too.
- Make rocksdb.range_locking test survive --repeat=N runs.

---
 .../suite/rocksdb/include/select_from_is_rowlocks.inc  |  2 +-
 mysql-test/suite/rocksdb/r/range_locking.result        | 11 +++++++++++
 mysql-test/suite/rocksdb/t/range_locking.inc           | 18 +++++++++++++++++-
 rocksdb                                                |  2 +-
 4 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/mysql-test/suite/rocksdb/include/select_from_is_rowlocks.inc b/mysql-test/suite/rocksdb/include/select_from_is_rowlocks.inc
index da80d466012..cb95b149bae 100644
--- a/mysql-test/suite/rocksdb/include/select_from_is_rowlocks.inc
+++ b/mysql-test/suite/rocksdb/include/select_from_is_rowlocks.inc
@@ -17,7 +17,7 @@ set @cf_id=(select column_family from information_schema.rocksdb_ddl
             where table_name='t1' and index_name='PRIMARY');
 set @rtrx_id=(select transaction_id from information_schema.rocksdb_trx
               where thread_id=connection_id());
-set @indexnr= (select lpad(hex(index_number),6,'0') from information_schema.rocksdb_ddl
+set @indexnr= (select lower(lpad(hex(index_number),6,'0')) from information_schema.rocksdb_ddl
                where table_name='t1' and index_name='PRIMARY');
 
 set @indexnr_next= (select lpad(hex(index_number+1),6,'0') from information_schema.rocksdb_ddl
diff --git a/mysql-test/suite/rocksdb/r/range_locking.result b/mysql-test/suite/rocksdb/r/range_locking.result
index f9f77a31476..bee37926ddf 100644
--- a/mysql-test/suite/rocksdb/r/range_locking.result
+++ b/mysql-test/suite/rocksdb/r/range_locking.result
@@ -80,6 +80,12 @@ drop table t1;
 #
 # Test INFORMATION_SCHEMA.lock_info in range-locking mode
 #
+connect  con1,localhost,root,,;
+connection con1;
+create table t0 (a int primary key);
+begin;
+insert into t0 values (1);
+connection default;
 create table t1 (
 pk int,
 a int,
@@ -111,6 +117,11 @@ $cf_id	$trx_id	0000${indexnr}80000002 - 0100${indexnr}80000009	X
 $cf_id	$trx_id	0000${indexnr}8000000a	X
 rollback;
 drop table t1;
+connection con1;
+rollback;
+drop table t0;
+connection default;
+disconnect con1;
 #
 # MDEV-18104: MyRocks-Gap-Lock: range locking bounds are incorrect for multi-part keys
 #
diff --git a/mysql-test/suite/rocksdb/t/range_locking.inc b/mysql-test/suite/rocksdb/t/range_locking.inc
index 1c5fb92b584..ecc8e4432bb 100644
--- a/mysql-test/suite/rocksdb/t/range_locking.inc
+++ b/mysql-test/suite/rocksdb/t/range_locking.inc
@@ -90,7 +90,7 @@ connection con1;
 rollback;
 drop table t2;
 
-# Cleanup
+# cleanup
 connection default;
 disconnect con1;
 disconnect con2;
@@ -99,6 +99,15 @@ drop table t1;
 --echo #
 --echo # Test INFORMATION_SCHEMA.lock_info in range-locking mode
 --echo #
+
+connect (con1,localhost,root,,);
+connection con1;
+eval create table t0 (a int primary key);
+begin;
+insert into t0 values (1);
+connection default;
+
+
 eval
 create table t1 (
   pk int,
@@ -112,6 +121,8 @@ insert into t1 values
 begin;
 select * from t1 where pk=10 for update;
 
+#let TRX1_ID=`(select transaction_id from information_schema.rocksdb_trx where thread_id=connection_id())` ;
+let $select_from_is_rowlocks_current_trx_only=1;
 --source suite/rocksdb/include/select_from_is_rowlocks.inc
 
 delete from t1 where pk between 25 and 40;
@@ -127,6 +138,11 @@ select * from t1 where pk between 2 and 9 for update;
 rollback;
 
 drop table t1;
+connection con1;
+rollback;
+drop table t0;
+connection default;
+disconnect con1;
 
 --echo #
 --echo # MDEV-18104: MyRocks-Gap-Lock: range locking bounds are incorrect for multi-part keys
diff --git a/rocksdb b/rocksdb
index c15474bf496..670bbd25c10 160000
--- a/rocksdb
+++ b/rocksdb
@@ -1 +1 @@
-Subproject commit c15474bf496a227c6247e2e56040009c55c4bbc0
+Subproject commit 670bbd25c10c47638f41ee7f635a99443d21e937


More information about the commits mailing list