Skip to content
Permalink
Browse files

rocksdb.unique_check: attempt to remove race condtitions from the test

  • Loading branch information...
spetrunia committed Jul 16, 2019
1 parent 143fede commit 612f4908d2f048ef5db45b184875af8d21c9fd4d
@@ -66,13 +66,14 @@ 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 go1';
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked1 WAIT_FOR go';
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 go2';
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked2 WAIT_FOR go';
insert into t2 values (1,1,1);
connection default;
set debug_sync='now WAIT_FOR parked1';
set debug_sync='now WAIT_FOR parked2';
connection con3;
set session rocksdb_lock_wait_timeout=1;
@@ -81,8 +82,7 @@ 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 go1';
set debug_sync='now SIGNAL go2';
set debug_sync='now SIGNAL go';
connection con1;
connection con2;
connection default;
@@ -102,15 +102,17 @@ 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 go1';
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked1 WAIT_FOR go';
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 go2';
set debug_sync='rocksdb.update_write_row_after_unique_check SIGNAL parked2 WAIT_FOR go';
send insert into t2 values (1,1,1);

connection default;
set debug_sync='now WAIT_FOR parked1';
set debug_sync='now WAIT_FOR parked2';

connection con3;
@@ -121,8 +123,7 @@ insert into t1 values (1,2);
insert into t2 values (2,1,2);

connection default;
set debug_sync='now SIGNAL go1';
set debug_sync='now SIGNAL go2';
set debug_sync='now SIGNAL go';

connection con1;
reap;

0 comments on commit 612f490

Please sign in to comment.
You can’t perform that action at this time.