File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,12 @@ step s3a4: LOCK TABLE a4; <waiting ...>
1515step s4a5: LOCK TABLE a5; <waiting ...>
1616step s5a6: LOCK TABLE a6; <waiting ...>
1717step s6a7: LOCK TABLE a7; <waiting ...>
18- step s7a8: LOCK TABLE a8; SELECT pg_sleep(5); <waiting ...>
18+ step s7a8: LOCK TABLE a8; <waiting ...>
1919step s8a1: LOCK TABLE a1; <waiting ...>
2020step s8a1: <... completed>
21- ERROR: deadlock detected
22- step s8c: COMMIT;
2321step s7a8: <... completed>
24- pg_sleep
25-
26-
22+ error in steps s8a1 s7a8: ERROR: deadlock detected
23+ step s8c: COMMIT;
2724step s7c: COMMIT;
2825step s6a7: <... completed>
2926step s6c: COMMIT;
Original file line number Diff line number Diff line change 11# This is a straightforward deadlock scenario. Since it involves more than
22# two processes, the main lock detector will find the problem and rollback
33# the session that first discovers it. Set deadlock_timeout in each session
4- # so that it's predictable which session fails. Also, when s8 fails and
5- # rolls back, it unblocks s7, so that there is a race as to whether s7a8
6- # or s8a1 will report first. Add a delay in s7a8 to make that predictable.
4+ # so that it's predictable which session fails.
75
86setup
97{
@@ -61,7 +59,7 @@ step "s6c" { COMMIT; }
6159session "s7"
6260setup { BEGIN ; SET deadlock_timeout = '100s' ; }
6361step "s7a7" { LOCK TABLE a7 ; }
64- step "s7a8" { LOCK TABLE a8 ; SELECT pg_sleep ( 5 ); }
62+ step "s7a8" { LOCK TABLE a8 ; }
6563step "s7c" { COMMIT ; }
6664
6765session "s8"
You can’t perform that action at this time.
0 commit comments