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

Commitc957813

Browse files
committed
Add isolationtester spec for old heapam.c bug
In0e5680f, I fixed a bug in heapam that caused spurious deadlockswhen multiple updates concurrently attempted to modify the old versionof an updated tuple whose new version was key-share locked. I proposedan isolationtester spec file that reproduced the bug, but back thenisolationtester wasn't mature enough to be able to run it. Now that38f8bdc is in the tree, we can have this spec file too.Discussion:https://www.postgresql.org/message-id/20141212205254.GC1768%40alvh.no-ip.org
1 parent74d5842 commitc957813

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Parsed test spec with 4 sessions
2+
3+
starting permutation: s1_advlock s2_update s3_update s4_update s1_chain s1_begin s1_grablock s1_advunlock s1_commit
4+
step s1_advlock: SELECT pg_advisory_lock(142857);
5+
pg_advisory_lock
6+
7+
8+
step s2_update: UPDATE pktab SET data = DEFAULT WHERE pg_advisory_lock_shared(142857) IS NOT NULL; <waiting ...>
9+
step s3_update: UPDATE pktab SET data = DEFAULT WHERE pg_advisory_lock_shared(142857) IS NOT NULL; <waiting ...>
10+
step s4_update: UPDATE pktab SET data = DEFAULT WHERE pg_advisory_lock_shared(142857) IS NOT NULL; <waiting ...>
11+
step s1_chain: UPDATE pktab SET data = DEFAULT;
12+
step s1_begin: BEGIN;
13+
step s1_grablock: SELECT * FROM pktab FOR KEY SHARE;
14+
id data
15+
16+
1 2
17+
step s1_advunlock: SELECT pg_advisory_unlock(142857);
18+
pg_advisory_unlock
19+
20+
t
21+
step s2_update: <... completed>
22+
step s3_update: <... completed>
23+
step s4_update: <... completed>
24+
step s1_commit: COMMIT;

‎src/test/isolation/isolation_schedule

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ test: multixact-no-deadlock
3131
test: multixact-no-forget
3232
test: propagate-lock-delete
3333
test: tuplelock-conflict
34+
test: tuplelock-update
3435
test: nowait
3536
test: nowait-2
3637
test: nowait-3
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
setup {
2+
DROPTABLEIFEXISTSpktab;
3+
CREATETABLEpktab (idintPRIMARYKEY,dataSERIALNOTNULL);
4+
INSERTINTOpktabVALUES (1,DEFAULT);
5+
}
6+
7+
teardown {
8+
DROPTABLEpktab;
9+
}
10+
11+
session"s1"
12+
step"s1_advlock" {SELECTpg_advisory_lock(142857); }
13+
step"s1_chain" {UPDATEpktabSETdata=DEFAULT; }
14+
step"s1_begin" {BEGIN; }
15+
step"s1_grablock" {SELECT*FROMpktabFORKEYSHARE; }
16+
step"s1_advunlock" {SELECTpg_advisory_unlock(142857); }
17+
step"s1_commit" {COMMIT; }
18+
19+
session"s2"
20+
step"s2_update" {UPDATEpktabSETdata=DEFAULTWHEREpg_advisory_lock_shared(142857)ISNOTNULL; }
21+
22+
session"s3"
23+
step"s3_update" {UPDATEpktabSETdata=DEFAULTWHEREpg_advisory_lock_shared(142857)ISNOTNULL; }
24+
25+
session"s4"
26+
step"s4_update" {UPDATEpktabSETdata=DEFAULTWHEREpg_advisory_lock_shared(142857)ISNOTNULL; }
27+
28+
permutation"s1_advlock""s2_update""s3_update""s4_update""s1_chain""s1_begin""s1_grablock""s1_advunlock""s1_commit"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp