File tree 2 files changed +5
-10
lines changed 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 ...>
15
15
step s4a5: LOCK TABLE a5; <waiting ...>
16
16
step s5a6: LOCK TABLE a6; <waiting ...>
17
17
step s6a7: LOCK TABLE a7; <waiting ...>
18
- step s7a8: LOCK TABLE a8; SELECT pg_sleep(5); <waiting ...>
18
+ step s7a8: LOCK TABLE a8; <waiting ...>
19
19
step s8a1: LOCK TABLE a1; <waiting ...>
20
20
step s8a1: <... completed>
21
- ERROR: deadlock detected
22
- step s8c: COMMIT;
23
21
step s7a8: <... completed>
24
- pg_sleep
25
-
26
-
22
+ error in steps s8a1 s7a8: ERROR: deadlock detected
23
+ step s8c: COMMIT;
27
24
step s7c: COMMIT;
28
25
step s6a7: <... completed>
29
26
step s6c: COMMIT;
Original file line number Diff line number Diff line change 1
1
# This is a straightforward deadlock scenario. Since it involves more than
2
2
# two processes, the main lock detector will find the problem and rollback
3
3
# 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.
7
5
8
6
setup
9
7
{
@@ -61,7 +59,7 @@ step "s6c" { COMMIT; }
61
59
session "s7"
62
60
setup { BEGIN ; SET deadlock_timeout = '100s' ; }
63
61
step "s7a7" { LOCK TABLE a7 ; }
64
- step "s7a8" { LOCK TABLE a8 ; SELECT pg_sleep ( 5 ); }
62
+ step "s7a8" { LOCK TABLE a8 ; }
65
63
step "s7c" { COMMIT ; }
66
64
67
65
session "s8"
You can’t perform that action at this time.
0 commit comments