Commit d71197cd authored by Alvaro Herrera's avatar Alvaro Herrera

Set different deadlock_timeout on each session in new isolation tests

This provides deterministic deadlock-detection ordering for new
isolation tests, fixing the sporadic failures in them.

Author: Noah Misch
parent bf3c5856
...@@ -32,8 +32,8 @@ step s1i: INSERT INTO child VALUES (1, 1); ...@@ -32,8 +32,8 @@ step s1i: INSERT INTO child VALUES (1, 1);
step s2i: INSERT INTO child VALUES (2, 1); step s2i: INSERT INTO child VALUES (2, 1);
step s2u: UPDATE parent SET aux = 'baz'; <waiting ...> step s2u: UPDATE parent SET aux = 'baz'; <waiting ...>
step s1u: UPDATE parent SET aux = 'bar'; step s1u: UPDATE parent SET aux = 'bar';
step s2u: <... completed>
ERROR: deadlock detected ERROR: deadlock detected
step s2u: <... completed>
step s2c: COMMIT; step s2c: COMMIT;
step s1c: COMMIT; step s1c: COMMIT;
...@@ -52,8 +52,8 @@ step s2i: INSERT INTO child VALUES (2, 1); ...@@ -52,8 +52,8 @@ step s2i: INSERT INTO child VALUES (2, 1);
step s1i: INSERT INTO child VALUES (1, 1); step s1i: INSERT INTO child VALUES (1, 1);
step s2u: UPDATE parent SET aux = 'baz'; <waiting ...> step s2u: UPDATE parent SET aux = 'baz'; <waiting ...>
step s1u: UPDATE parent SET aux = 'bar'; step s1u: UPDATE parent SET aux = 'bar';
step s2u: <... completed>
ERROR: deadlock detected ERROR: deadlock detected
step s2u: <... completed>
step s2c: COMMIT; step s2c: COMMIT;
step s1c: COMMIT; step s1c: COMMIT;
......
...@@ -42,8 +42,8 @@ step s1u1: UPDATE A SET Col1 = 1 WHERE AID = 1; ...@@ -42,8 +42,8 @@ step s1u1: UPDATE A SET Col1 = 1 WHERE AID = 1;
step s2u1: UPDATE B SET Col2 = 1 WHERE BID = 2; step s2u1: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s2u2: UPDATE B SET Col2 = 1 WHERE BID = 2; <waiting ...> step s2u2: UPDATE B SET Col2 = 1 WHERE BID = 2; <waiting ...>
step s1u2: UPDATE B SET Col2 = 1 WHERE BID = 2; step s1u2: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s2u2: <... completed>
ERROR: deadlock detected ERROR: deadlock detected
step s2u2: <... completed>
step s1c: COMMIT; step s1c: COMMIT;
step s2c: COMMIT; step s2c: COMMIT;
...@@ -52,8 +52,8 @@ step s1u1: UPDATE A SET Col1 = 1 WHERE AID = 1; ...@@ -52,8 +52,8 @@ step s1u1: UPDATE A SET Col1 = 1 WHERE AID = 1;
step s2u1: UPDATE B SET Col2 = 1 WHERE BID = 2; step s2u1: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s2u2: UPDATE B SET Col2 = 1 WHERE BID = 2; <waiting ...> step s2u2: UPDATE B SET Col2 = 1 WHERE BID = 2; <waiting ...>
step s1u2: UPDATE B SET Col2 = 1 WHERE BID = 2; step s1u2: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s2u2: <... completed>
ERROR: deadlock detected ERROR: deadlock detected
step s2u2: <... completed>
step s2c: COMMIT; step s2c: COMMIT;
step s1c: COMMIT; step s1c: COMMIT;
...@@ -82,8 +82,8 @@ step s2u1: UPDATE B SET Col2 = 1 WHERE BID = 2; ...@@ -82,8 +82,8 @@ step s2u1: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s1u1: UPDATE A SET Col1 = 1 WHERE AID = 1; step s1u1: UPDATE A SET Col1 = 1 WHERE AID = 1;
step s2u2: UPDATE B SET Col2 = 1 WHERE BID = 2; <waiting ...> step s2u2: UPDATE B SET Col2 = 1 WHERE BID = 2; <waiting ...>
step s1u2: UPDATE B SET Col2 = 1 WHERE BID = 2; step s1u2: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s2u2: <... completed>
ERROR: deadlock detected ERROR: deadlock detected
step s2u2: <... completed>
step s1c: COMMIT; step s1c: COMMIT;
step s2c: COMMIT; step s2c: COMMIT;
...@@ -92,8 +92,8 @@ step s2u1: UPDATE B SET Col2 = 1 WHERE BID = 2; ...@@ -92,8 +92,8 @@ step s2u1: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s1u1: UPDATE A SET Col1 = 1 WHERE AID = 1; step s1u1: UPDATE A SET Col1 = 1 WHERE AID = 1;
step s2u2: UPDATE B SET Col2 = 1 WHERE BID = 2; <waiting ...> step s2u2: UPDATE B SET Col2 = 1 WHERE BID = 2; <waiting ...>
step s1u2: UPDATE B SET Col2 = 1 WHERE BID = 2; step s1u2: UPDATE B SET Col2 = 1 WHERE BID = 2;
step s2u2: <... completed>
ERROR: deadlock detected ERROR: deadlock detected
step s2u2: <... completed>
step s2c: COMMIT; step s2c: COMMIT;
step s1c: COMMIT; step s1c: COMMIT;
......
...@@ -19,13 +19,13 @@ teardown ...@@ -19,13 +19,13 @@ teardown
} }
session "s1" session "s1"
setup { BEGIN; } setup { BEGIN; SET deadlock_timeout = '20ms'; }
step "s1i" { INSERT INTO child VALUES (1, 1); } step "s1i" { INSERT INTO child VALUES (1, 1); }
step "s1u" { UPDATE parent SET aux = 'bar'; } step "s1u" { UPDATE parent SET aux = 'bar'; }
step "s1c" { COMMIT; } step "s1c" { COMMIT; }
session "s2" session "s2"
setup { BEGIN; } setup { BEGIN; SET deadlock_timeout = '10s'; }
step "s2i" { INSERT INTO child VALUES (2, 1); } step "s2i" { INSERT INTO child VALUES (2, 1); }
step "s2u" { UPDATE parent SET aux = 'baz'; } step "s2u" { UPDATE parent SET aux = 'baz'; }
step "s2c" { COMMIT; } step "s2c" { COMMIT; }
......
...@@ -24,13 +24,13 @@ teardown ...@@ -24,13 +24,13 @@ teardown
} }
session "s1" session "s1"
setup { BEGIN; } setup { BEGIN; SET deadlock_timeout = '20ms'; }
step "s1u1" { UPDATE A SET Col1 = 1 WHERE AID = 1; } step "s1u1" { UPDATE A SET Col1 = 1 WHERE AID = 1; }
step "s1u2" { UPDATE B SET Col2 = 1 WHERE BID = 2; } step "s1u2" { UPDATE B SET Col2 = 1 WHERE BID = 2; }
step "s1c" { COMMIT; } step "s1c" { COMMIT; }
session "s2" session "s2"
setup { BEGIN; } setup { BEGIN; SET deadlock_timeout = '10s'; }
step "s2u1" { UPDATE B SET Col2 = 1 WHERE BID = 2; } step "s2u1" { UPDATE B SET Col2 = 1 WHERE BID = 2; }
step "s2u2" { UPDATE B SET Col2 = 1 WHERE BID = 2; } step "s2u2" { UPDATE B SET Col2 = 1 WHERE BID = 2; }
step "s2c" { COMMIT; } step "s2c" { COMMIT; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment