diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
commit | a175314c3e5827eb193872241446f2f8f5c9d33c (patch) | |
tree | cd3d60ca99ae00829c52a6ca79150a5b6e62528b /storage/rocksdb/mysql-test/rocksdb/t/deadlock.test | |
parent | Initial commit. (diff) | |
download | mariadb-10.5-upstream.tar.xz mariadb-10.5-upstream.zip |
Adding upstream version 1:10.5.12.upstream/1%10.5.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'storage/rocksdb/mysql-test/rocksdb/t/deadlock.test')
-rw-r--r-- | storage/rocksdb/mysql-test/rocksdb/t/deadlock.test | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/deadlock.test b/storage/rocksdb/mysql-test/rocksdb/t/deadlock.test new file mode 100644 index 00000000..656be9eb --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb/t/deadlock.test @@ -0,0 +1,44 @@ +--echo # +--echo # Validate that deadlock errors don't occur with a high level of concurrency +--echo # + +--source include/have_rocksdb.inc +--source include/big_test.inc + +--echo # Disable for valgrind because this takes too long +--source include/not_valgrind.inc + +--disable_warnings +DROP DATABASE IF EXISTS mysqlslap; +--enable_warnings + +CREATE DATABASE mysqlslap; +USE mysqlslap; +CREATE TABLE t1(id1 BIGINT, id2 BIGINT, count INT, PRIMARY KEY(id1, id2), KEY(id2)) ENGINE=rocksdb; +CREATE TABLE t1rev(id1 BIGINT, id2 BIGINT, count INT, PRIMARY KEY(id1, id2) COMMENT "rev:cf2", KEY(id2) COMMENT "rev:cf2") ENGINE=rocksdb; + +SET @save = @@global.rocksdb_lock_wait_timeout; +SET GLOBAL rocksdb_lock_wait_timeout = 60; + +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="INSERT INTO t1 VALUES(1, 1, 1) ON DUPLICATE KEY UPDATE count=count+1" +SELECT count from t1; +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="UPDATE t1 SET count=count+1 WHERE id1=1 AND id2=1" +SELECT count from t1; +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="UPDATE t1 SET count=count+1 WHERE id2=1" +SELECT count from t1; +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="UPDATE t1 SET count=count+1" +SELECT count from t1; + +# Same tests on a table with reverse orderings +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="INSERT INTO t1rev VALUES(1, 1, 1) ON DUPLICATE KEY UPDATE count=count+1" +SELECT count from t1rev; +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="UPDATE t1rev SET count=count+1 WHERE id1=1 AND id2=1" +SELECT count from t1rev; +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="UPDATE t1rev SET count=count+1 WHERE id2=1" +SELECT count from t1rev; +--exec $MYSQL_SLAP --silent --concurrency=50 --number-of-queries=50000 --query="UPDATE t1rev SET count=count+1" +SELECT count from t1rev; + +SET GLOBAL rocksdb_lock_wait_timeout = @save; + +DROP DATABASE mysqlslap; |