Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb11d07b

Browse files
committed
Make new deadlock isolation test more reproducible.
The original formulation of4c9864bwas extremely timing-sensitive, because it arranged for the deadlockdetector to be running (and possibly unblocking the current query)at almost exactly the same time as isolationtester would be probingto see if the query is blocked. The committed expected-file assumedthat the deadlock detection would finish first, but we see the oppositeon both fast and slow buildfarm animals. Adjust the deadlock timeoutsettings to make it predictable that isolationtester *will* see thequery as waiting before deadlock detection unblocks it.I used a 5s timeout for the same reasons mentioned ina7921f7.
1 parentd9dc2b4 commitb11d07b

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

‎src/test/isolation/expected/deadlock-hard.out

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ step s4a5: LOCK TABLE a5; <waiting ...>
1616
step s5a6: LOCK TABLE a6; <waiting ...>
1717
step s6a7: LOCK TABLE a7; <waiting ...>
1818
step s7a8: LOCK TABLE a8; <waiting ...>
19-
step s8a1: LOCK TABLE a1;
19+
step s8a1: LOCK TABLE a1; <waiting ...>
20+
step s8a1: <... completed>
2021
step s7a8: <... completed>
2122
error in steps s8a1 s7a8: ERROR: deadlock detected
2223
step s8c: COMMIT;

‎src/test/isolation/specs/deadlock-hard.spec

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This is a straightforward deadlock scenario. Since it involves more than
2-
# two processes, the mainlock detector will find the problem and rollback the
3-
# backend which discovers it.
2+
# two processes, the main lock detector will find the problem and rollback
3+
# the session that first discovers it. Set deadlock_timeout in each session
4+
# so that it's predictable which session fails.
45

56
setup
67
{
@@ -20,49 +21,49 @@ teardown
2021
}
2122

2223
session"s1"
23-
setup{BEGIN;SETdeadlock_timeout='10s'; }
24+
setup{BEGIN;SETdeadlock_timeout='100s'; }
2425
step"s1a1"{LOCKTABLEa1; }
2526
step"s1a2"{LOCKTABLEa2; }
2627
step"s1c"{COMMIT; }
2728

2829
session"s2"
29-
setup{BEGIN;SETdeadlock_timeout='10s'; }
30+
setup{BEGIN;SETdeadlock_timeout='100s'; }
3031
step"s2a2"{LOCKTABLEa2; }
3132
step"s2a3"{LOCKTABLEa3; }
3233
step"s2c"{COMMIT; }
3334

3435
session"s3"
35-
setup{BEGIN;SETdeadlock_timeout='10s'; }
36+
setup{BEGIN;SETdeadlock_timeout='100s'; }
3637
step"s3a3"{LOCKTABLEa3; }
3738
step"s3a4"{LOCKTABLEa4; }
3839
step"s3c"{COMMIT; }
3940

4041
session"s4"
41-
setup{BEGIN;SETdeadlock_timeout='10s'; }
42+
setup{BEGIN;SETdeadlock_timeout='100s'; }
4243
step"s4a4"{LOCKTABLEa4; }
4344
step"s4a5"{LOCKTABLEa5; }
4445
step"s4c"{COMMIT; }
4546

4647
session"s5"
47-
setup{BEGIN;SETdeadlock_timeout='10s'; }
48+
setup{BEGIN;SETdeadlock_timeout='100s'; }
4849
step"s5a5"{LOCKTABLEa5; }
4950
step"s5a6"{LOCKTABLEa6; }
5051
step"s5c"{COMMIT; }
5152

5253
session"s6"
53-
setup{BEGIN;SETdeadlock_timeout='10s'; }
54+
setup{BEGIN;SETdeadlock_timeout='100s'; }
5455
step"s6a6"{LOCKTABLEa6; }
5556
step"s6a7"{LOCKTABLEa7; }
5657
step"s6c"{COMMIT; }
5758

5859
session"s7"
59-
setup{BEGIN;SETdeadlock_timeout='10s'; }
60+
setup{BEGIN;SETdeadlock_timeout='100s'; }
6061
step"s7a7"{LOCKTABLEa7; }
6162
step"s7a8"{LOCKTABLEa8; }
6263
step"s7c"{COMMIT; }
6364

6465
session"s8"
65-
setup{BEGIN;SETdeadlock_timeout='10ms'; }
66+
setup{BEGIN;SETdeadlock_timeout='5s'; }
6667
step"s8a8"{LOCKTABLEa8; }
6768
step"s8a1"{LOCKTABLEa1; }
6869
step"s8c"{COMMIT; }

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp