-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-19090 - Split rocksdb.locking_issues
This test takes ~6 minutes, split it for better parallelism.
- Loading branch information
Sergey Vojtovich
committed
May 16, 2019
1 parent
a24dffd
commit 76a94a0
Showing
42 changed files
with
764 additions
and
739 deletions.
There are no files selected for viewing
675 changes: 1 addition & 674 deletions
675
storage/rocksdb/mysql-test/rocksdb/r/locking_issues.result
Large diffs are not rendered by default.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
storage/rocksdb/mysql-test/rocksdb/r/locking_issues_case1_1_rc.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
----------------------------------------------------------------------- | ||
- Locking issues case 1.1: | ||
- Locking rows that do not exist when using all primary key columns in | ||
- a WHERE clause | ||
- using READ COMMITTED transaction isolation level | ||
----------------------------------------------------------------------- | ||
DROP TABLE IF EXISTS t0; | ||
CREATE TABLE t0(id1 INT, id2 INT, value INT, PRIMARY KEY(id1, id2)); | ||
INSERT INTO t0 VALUES (1,1,0), (3,3,0), (4,4,0), (6,6,0); | ||
connect con1,localhost,root,,; | ||
connect con2,localhost,root,,; | ||
connection con1; | ||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; | ||
BEGIN; | ||
SELECT * FROM t0 WHERE id1=1 AND id2=5 FOR UPDATE; | ||
id1 id2 value | ||
connection con2; | ||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; | ||
BEGIN; | ||
INSERT INTO t0 VALUES (1,5,0); | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
SELECT * FROM t0 WHERE id1=1 AND id2=5 FOR UPDATE; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
connection con1; | ||
COMMIT; | ||
connection default; | ||
disconnect con1; | ||
disconnect con2; | ||
DROP TABLE t0; |
30 changes: 30 additions & 0 deletions
30
storage/rocksdb/mysql-test/rocksdb/r/locking_issues_case1_1_rr.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
----------------------------------------------------------------------- | ||
- Locking issues case 1.1: | ||
- Locking rows that do not exist when using all primary key columns in | ||
- a WHERE clause | ||
- using REPEATABLE READ transaction isolation level | ||
----------------------------------------------------------------------- | ||
DROP TABLE IF EXISTS t0; | ||
CREATE TABLE t0(id1 INT, id2 INT, value INT, PRIMARY KEY(id1, id2)); | ||
INSERT INTO t0 VALUES (1,1,0), (3,3,0), (4,4,0), (6,6,0); | ||
connect con1,localhost,root,,; | ||
connect con2,localhost,root,,; | ||
connection con1; | ||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; | ||
BEGIN; | ||
SELECT * FROM t0 WHERE id1=1 AND id2=5 FOR UPDATE; | ||
id1 id2 value | ||
connection con2; | ||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; | ||
BEGIN; | ||
INSERT INTO t0 VALUES (1,5,0); | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
SELECT * FROM t0 WHERE id1=1 AND id2=5 FOR UPDATE; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
connection con1; | ||
COMMIT; | ||
connection default; | ||
disconnect con1; | ||
disconnect con2; | ||
DROP TABLE t0; |
30 changes: 30 additions & 0 deletions
30
storage/rocksdb/mysql-test/rocksdb/r/locking_issues_case1_2_rc.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
----------------------------------------------------------------------- | ||
- Locking issues case 1.2: | ||
- Locking rows that do not exist without using all primary key | ||
- columns in a WHERE clause | ||
- using READ COMMITTED transaction isolation level | ||
----------------------------------------------------------------------- | ||
DROP TABLE IF EXISTS t0; | ||
CREATE TABLE t0(id1 INT, id2 INT, value INT, PRIMARY KEY(id1, id2)); | ||
INSERT INTO t0 VALUES (1,1,0), (3,3,0), (4,4,0), (6,6,0); | ||
connect con1,localhost,root,,; | ||
connect con2,localhost,root,,; | ||
connection con1; | ||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; | ||
BEGIN; | ||
SELECT * FROM t0 WHERE id1=1 FOR UPDATE; | ||
id1 id2 value | ||
1 1 0 | ||
connection con2; | ||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; | ||
BEGIN; | ||
SELECT * FROM t0 WHERE id1=1 AND id2=4 FOR UPDATE; | ||
id1 id2 value | ||
INSERT INTO t0 VALUES (1,5,0); | ||
connection con1; | ||
COMMIT; | ||
connection default; | ||
disconnect con1; | ||
disconnect con2; | ||
DROP TABLE t0; |
30 changes: 30 additions & 0 deletions
30
storage/rocksdb/mysql-test/rocksdb/r/locking_issues_case1_2_rr.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
----------------------------------------------------------------------- | ||
- Locking issues case 1.2: | ||
- Locking rows that do not exist without using all primary key | ||
- columns in a WHERE clause | ||
- using REPEATABLE READ transaction isolation level | ||
----------------------------------------------------------------------- | ||
DROP TABLE IF EXISTS t0; | ||
CREATE TABLE t0(id1 INT, id2 INT, value INT, PRIMARY KEY(id1, id2)); | ||
INSERT INTO t0 VALUES (1,1,0), (3,3,0), (4,4,0), (6,6,0); | ||
connect con1,localhost,root,,; | ||
connect con2,localhost,root,,; | ||
connection con1; | ||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; | ||
BEGIN; | ||
SELECT * FROM t0 WHERE id1=1 FOR UPDATE; | ||
id1 id2 value | ||
1 1 0 | ||
connection con2; | ||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; | ||
BEGIN; | ||
SELECT * FROM t0 WHERE id1=1 AND id2=4 FOR UPDATE; | ||
id1 id2 value | ||
INSERT INTO t0 VALUES (1,5,0); | ||
connection con1; | ||
COMMIT; | ||
connection default; | ||
disconnect con1; | ||
disconnect con2; | ||
DROP TABLE t0; |
50 changes: 50 additions & 0 deletions
50
storage/rocksdb/mysql-test/rocksdb/r/locking_issues_case2_rc.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
----------------------------------------------------------------------- | ||
- Locking issues case 2: | ||
- Rows that are scanned but do not match the WHERE are not locked | ||
- using READ COMMITTED transaction isolation level unless | ||
- rocksdb_lock_scanned_rows is on | ||
----------------------------------------------------------------------- | ||
DROP TABLE IF EXISTS t0; | ||
SELECT @@global.rocksdb_lock_scanned_rows; | ||
@@global.rocksdb_lock_scanned_rows | ||
0 | ||
CREATE TABLE t0(id INT PRIMARY KEY, value INT); | ||
INSERT INTO t0 VALUES (1,0), (2,1), (3,0), (4,0), (5,1); | ||
connect con1,localhost,root,,; | ||
connect con2,localhost,root,,; | ||
connection con1; | ||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; | ||
BEGIN; | ||
connection con2; | ||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; | ||
BEGIN; | ||
connection con1; | ||
SELECT * FROM t0 WHERE value > 0 FOR UPDATE; | ||
id value | ||
2 1 | ||
5 1 | ||
connection con2; | ||
UPDATE t0 SET VALUE=10 WHERE id=1; | ||
UPDATE t0 SET VALUE=10 WHERE id=5; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
connection con1; | ||
UPDATE t0 SET value=100 WHERE id in (4,5) and value>0; | ||
connection con2; | ||
SELECT * FROM t0 WHERE id=4 FOR UPDATE; | ||
id value | ||
4 0 | ||
COMMIT; | ||
SELECT * FROM t0; | ||
id value | ||
1 10 | ||
2 1 | ||
3 0 | ||
4 0 | ||
5 1 | ||
connection con1; | ||
COMMIT; | ||
connection default; | ||
disconnect con1; | ||
disconnect con2; | ||
DROP TABLE t0; |
37 changes: 37 additions & 0 deletions
37
storage/rocksdb/mysql-test/rocksdb/r/locking_issues_case2_rc_lsr.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
----------------------------------------------------------------------- | ||
- Locking issues case 2: | ||
- Rows that are scanned but do not match the WHERE are not locked | ||
- using READ COMMITTED transaction isolation level unless | ||
- rocksdb_lock_scanned_rows is on | ||
----------------------------------------------------------------------- | ||
DROP TABLE IF EXISTS t0; | ||
SELECT @@global.rocksdb_lock_scanned_rows; | ||
@@global.rocksdb_lock_scanned_rows | ||
0 | ||
SET GLOBAL rocksdb_lock_scanned_rows=ON; | ||
CREATE TABLE t0(id INT PRIMARY KEY, value INT); | ||
INSERT INTO t0 VALUES (1,0), (2,1), (3,0), (4,0), (5,1); | ||
connect con1,localhost,root,,; | ||
connect con2,localhost,root,,; | ||
connection con1; | ||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; | ||
BEGIN; | ||
connection con2; | ||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; | ||
BEGIN; | ||
connection con1; | ||
SELECT * FROM t0 WHERE value > 0 FOR UPDATE; | ||
id value | ||
2 1 | ||
5 1 | ||
connection con2; | ||
UPDATE t0 SET VALUE=10 WHERE id=1; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
connection con1; | ||
COMMIT; | ||
connection default; | ||
disconnect con1; | ||
disconnect con2; | ||
DROP TABLE t0; | ||
SET GLOBAL rocksdb_lock_scanned_rows=0; |
50 changes: 50 additions & 0 deletions
50
storage/rocksdb/mysql-test/rocksdb/r/locking_issues_case2_rr.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
----------------------------------------------------------------------- | ||
- Locking issues case 2: | ||
- Rows that are scanned but do not match the WHERE are not locked | ||
- using REPEATABLE READ transaction isolation level unless | ||
- rocksdb_lock_scanned_rows is on | ||
----------------------------------------------------------------------- | ||
DROP TABLE IF EXISTS t0; | ||
SELECT @@global.rocksdb_lock_scanned_rows; | ||
@@global.rocksdb_lock_scanned_rows | ||
0 | ||
CREATE TABLE t0(id INT PRIMARY KEY, value INT); | ||
INSERT INTO t0 VALUES (1,0), (2,1), (3,0), (4,0), (5,1); | ||
connect con1,localhost,root,,; | ||
connect con2,localhost,root,,; | ||
connection con1; | ||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; | ||
BEGIN; | ||
connection con2; | ||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; | ||
BEGIN; | ||
connection con1; | ||
SELECT * FROM t0 WHERE value > 0 FOR UPDATE; | ||
id value | ||
2 1 | ||
5 1 | ||
connection con2; | ||
UPDATE t0 SET VALUE=10 WHERE id=1; | ||
UPDATE t0 SET VALUE=10 WHERE id=5; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
connection con1; | ||
UPDATE t0 SET value=100 WHERE id in (4,5) and value>0; | ||
connection con2; | ||
SELECT * FROM t0 WHERE id=4 FOR UPDATE; | ||
id value | ||
4 0 | ||
COMMIT; | ||
SELECT * FROM t0; | ||
id value | ||
1 10 | ||
2 1 | ||
3 0 | ||
4 0 | ||
5 1 | ||
connection con1; | ||
COMMIT; | ||
connection default; | ||
disconnect con1; | ||
disconnect con2; | ||
DROP TABLE t0; |
37 changes: 37 additions & 0 deletions
37
storage/rocksdb/mysql-test/rocksdb/r/locking_issues_case2_rr_lsr.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
----------------------------------------------------------------------- | ||
- Locking issues case 2: | ||
- Rows that are scanned but do not match the WHERE are not locked | ||
- using REPEATABLE READ transaction isolation level unless | ||
- rocksdb_lock_scanned_rows is on | ||
----------------------------------------------------------------------- | ||
DROP TABLE IF EXISTS t0; | ||
SELECT @@global.rocksdb_lock_scanned_rows; | ||
@@global.rocksdb_lock_scanned_rows | ||
0 | ||
SET GLOBAL rocksdb_lock_scanned_rows=ON; | ||
CREATE TABLE t0(id INT PRIMARY KEY, value INT); | ||
INSERT INTO t0 VALUES (1,0), (2,1), (3,0), (4,0), (5,1); | ||
connect con1,localhost,root,,; | ||
connect con2,localhost,root,,; | ||
connection con1; | ||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; | ||
BEGIN; | ||
connection con2; | ||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; | ||
BEGIN; | ||
connection con1; | ||
SELECT * FROM t0 WHERE value > 0 FOR UPDATE; | ||
id value | ||
2 1 | ||
5 1 | ||
connection con2; | ||
UPDATE t0 SET VALUE=10 WHERE id=1; | ||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction | ||
connection con1; | ||
COMMIT; | ||
connection default; | ||
disconnect con1; | ||
disconnect con2; | ||
DROP TABLE t0; | ||
SET GLOBAL rocksdb_lock_scanned_rows=0; |
25 changes: 25 additions & 0 deletions
25
storage/rocksdb/mysql-test/rocksdb/r/locking_issues_case3_rc.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
----------------------------------------------------------------------- | ||
- Locking issues case 3: | ||
- After creating a snapshot, other clients updating rows | ||
- using READ COMMITTED transaction isolation level | ||
----------------------------------------------------------------------- | ||
DROP TABLE IF EXISTS t0; | ||
CREATE TABLE t0(id INT AUTO_INCREMENT PRIMARY KEY, value INT); | ||
Inserting 200,000 rows | ||
connect con1,localhost,root,,; | ||
connect con2,localhost,root,,; | ||
connection con1; | ||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; | ||
SELECT * FROM t0 WHERE value > 0 FOR UPDATE; | ||
connection con2; | ||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; | ||
UPDATE t0 SET VALUE=VALUE+1 WHERE id=190000; | ||
connection con1; | ||
id value | ||
190000 1 | ||
ERROR: 0 | ||
connection default; | ||
disconnect con1; | ||
disconnect con2; | ||
DROP TABLE t0; |
23 changes: 23 additions & 0 deletions
23
storage/rocksdb/mysql-test/rocksdb/r/locking_issues_case3_rr.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
----------------------------------------------------------------------- | ||
- Locking issues case 3: | ||
- After creating a snapshot, other clients updating rows | ||
- using REPEATABLE READ transaction isolation level | ||
----------------------------------------------------------------------- | ||
DROP TABLE IF EXISTS t0; | ||
CREATE TABLE t0(id INT AUTO_INCREMENT PRIMARY KEY, value INT); | ||
Inserting 200,000 rows | ||
connect con1,localhost,root,,; | ||
connect con2,localhost,root,,; | ||
connection con1; | ||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; | ||
SELECT * FROM t0 WHERE value > 0 FOR UPDATE; | ||
connection con2; | ||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; | ||
UPDATE t0 SET VALUE=VALUE+1 WHERE id=190000; | ||
connection con1; | ||
ERROR: 1213 | ||
connection default; | ||
disconnect con1; | ||
disconnect con2; | ||
DROP TABLE t0; |
23 changes: 23 additions & 0 deletions
23
storage/rocksdb/mysql-test/rocksdb/r/locking_issues_case4_rc.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
----------------------------------------------------------------------- | ||
- Locking issues case 4: | ||
- Phantom rows | ||
- using READ COMMITTED transaction isolation level | ||
----------------------------------------------------------------------- | ||
DROP TABLE IF EXISTS t0; | ||
CREATE TABLE t0(id INT AUTO_INCREMENT PRIMARY KEY, value INT); | ||
Inserting 200,000 rows | ||
connect con1,localhost,root,,; | ||
connect con2,localhost,root,,; | ||
connection con1; | ||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; | ||
SELECT * FROM t0 WHERE value > 0 FOR UPDATE; | ||
connection con2; | ||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; | ||
INSERT INTO t0 VALUES(200001,1), (-1,1); | ||
connection con1; | ||
id value | ||
connection default; | ||
disconnect con1; | ||
disconnect con2; | ||
DROP TABLE t0; |
23 changes: 23 additions & 0 deletions
23
storage/rocksdb/mysql-test/rocksdb/r/locking_issues_case4_rr.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
----------------------------------------------------------------------- | ||
- Locking issues case 4: | ||
- Phantom rows | ||
- using REPEATABLE READ transaction isolation level | ||
----------------------------------------------------------------------- | ||
DROP TABLE IF EXISTS t0; | ||
CREATE TABLE t0(id INT AUTO_INCREMENT PRIMARY KEY, value INT); | ||
Inserting 200,000 rows | ||
connect con1,localhost,root,,; | ||
connect con2,localhost,root,,; | ||
connection con1; | ||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; | ||
SELECT * FROM t0 WHERE value > 0 FOR UPDATE; | ||
connection con2; | ||
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; | ||
INSERT INTO t0 VALUES(200001,1), (-1,1); | ||
connection con1; | ||
id value | ||
connection default; | ||
disconnect con1; | ||
disconnect con2; | ||
DROP TABLE t0; |
Oops, something went wrong.