Fix rocksdb.unique_check: do not have two threads waiting on the same name

This commit is contained in:
Sergei Petrunia 2024-08-07 11:26:15 +03:00
parent d6444022ca
commit ba0d8aeffa
2 changed files with 8 additions and 6 deletions
storage/rocksdb/mysql-test/rocksdb

View file

@ -66,12 +66,12 @@ id id2 value
2 1 2
truncate table t2;
connection con1;
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked1 WAIT_FOR go';
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked1 WAIT_FOR go1';
insert into t1 values (1,1);
connection default;
set debug_sync='now WAIT_FOR parked1';
connection con2;
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked2 WAIT_FOR go';
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked2 WAIT_FOR go2';
insert into t2 values (1,1,1);
connection default;
set debug_sync='now WAIT_FOR parked2';
@ -82,7 +82,8 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into t2 values (2,1,2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection default;
set debug_sync='now SIGNAL go';
set debug_sync='now SIGNAL go1';
set debug_sync='now SIGNAL go2';
connection con1;
connection con2;
connection default;

View file

@ -102,14 +102,14 @@ truncate table t2;
# 4) simulating T1 GetForUpdate() -> T2 GetForUpdate(). T2 should fail with lock wait timeout.
connection con1;
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked1 WAIT_FOR go';
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked1 WAIT_FOR go1';
send insert into t1 values (1,1);
connection default;
set debug_sync='now WAIT_FOR parked1';
connection con2;
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked2 WAIT_FOR go';
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked2 WAIT_FOR go2';
send insert into t2 values (1,1,1);
connection default;
@ -123,7 +123,8 @@ insert into t1 values (1,2);
insert into t2 values (2,1,2);
connection default;
set debug_sync='now SIGNAL go';
set debug_sync='now SIGNAL go1';
set debug_sync='now SIGNAL go2';
connection con1;
reap;