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

Commit997563d

Browse files
committed
Try to harden insert-conflict-specconflict against autovacuum.
Looks like guaibasaurus had a autovacuum running during thecontroller_print_speculative_locks step (just added in43e0841). Which does indeed seem quite possible.Avoid the problem by only looking for the backends participating inthe test.
1 parentdcdbb5a commit997563d

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

‎src/test/isolation/expected/insert-conflict-specconflict.out

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,10 @@ s1: NOTICE: acquiring advisory lock on 2
361361
step controller_print_speculative_locks:
362362
SELECT pa.application_name, locktype, mode, granted
363363
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid)
364-
WHERE locktype IN ('speculative token', 'transactionid') AND pa.datname = current_database()
364+
WHERE
365+
locktype IN ('speculative token', 'transactionid')
366+
AND pa.datname = current_database()
367+
AND pa.application_name LIKE 'isolation/insert-conflict-specconflict-s%'
365368
ORDER BY 1, 2, 3, 4;
366369

367370
application_namelocktype mode granted
@@ -380,7 +383,10 @@ step s2_upsert: <... completed>
380383
step controller_print_speculative_locks:
381384
SELECT pa.application_name, locktype, mode, granted
382385
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid)
383-
WHERE locktype IN ('speculative token', 'transactionid') AND pa.datname = current_database()
386+
WHERE
387+
locktype IN ('speculative token', 'transactionid')
388+
AND pa.datname = current_database()
389+
AND pa.application_name LIKE 'isolation/insert-conflict-specconflict-s%'
384390
ORDER BY 1, 2, 3, 4;
385391

386392
application_namelocktype mode granted
@@ -399,7 +405,10 @@ k1 inserted s2 with conflict update s1
399405
step controller_print_speculative_locks:
400406
SELECT pa.application_name, locktype, mode, granted
401407
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid)
402-
WHERE locktype IN ('speculative token', 'transactionid') AND pa.datname = current_database()
408+
WHERE
409+
locktype IN ('speculative token', 'transactionid')
410+
AND pa.datname = current_database()
411+
AND pa.application_name LIKE 'isolation/insert-conflict-specconflict-s%'
403412
ORDER BY 1, 2, 3, 4;
404413

405414
application_namelocktype mode granted

‎src/test/isolation/specs/insert-conflict-specconflict.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ step "controller_show_count" {SELECT COUNT(*) FROM upserttest; }
6363
step"controller_print_speculative_locks"{
6464
SELECTpa.application_name,locktype,mode,granted
6565
FROMpg_locksplJOINpg_stat_activitypaUSING(pid)
66-
WHERElocktypeIN('speculative token','transactionid')ANDpa.datname=current_database()
66+
WHERE
67+
locktypeIN('speculative token','transactionid')
68+
ANDpa.datname=current_database()
69+
ANDpa.application_nameLIKE'isolation/insert-conflict-specconflict-s%'
6770
ORDERBY1,2,3,4;
6871
}
6972

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp