aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2020-02-11 21:14:08 -0800
committerAndres Freund <andres@anarazel.de>2020-02-11 21:18:14 -0800
commit997563dfcb2501a7a199589cd6f15f2bb8af3d04 (patch)
tree1fda7180a3f6a8cbebefd645aa17644c13123602 /src
parentdcdbb5a5db09064ac08ff3971c5031281ef2e545 (diff)
downloadpostgresql-997563dfcb2501a7a199589cd6f15f2bb8af3d04.tar.gz
postgresql-997563dfcb2501a7a199589cd6f15f2bb8af3d04.zip
Try to harden insert-conflict-specconflict against autovacuum.
Looks like guaibasaurus had a autovacuum running during the controller_print_speculative_locks step (just added in 43e08419708). Which does indeed seem quite possible. Avoid the problem by only looking for the backends participating in the test.
Diffstat (limited to 'src')
-rw-r--r--src/test/isolation/expected/insert-conflict-specconflict.out15
-rw-r--r--src/test/isolation/specs/insert-conflict-specconflict.spec5
2 files changed, 16 insertions, 4 deletions
diff --git a/src/test/isolation/expected/insert-conflict-specconflict.out b/src/test/isolation/expected/insert-conflict-specconflict.out
index f30bf9c94da..9be5ccf55f0 100644
--- a/src/test/isolation/expected/insert-conflict-specconflict.out
+++ b/src/test/isolation/expected/insert-conflict-specconflict.out
@@ -361,7 +361,10 @@ s1: NOTICE: acquiring advisory lock on 2
step controller_print_speculative_locks:
SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid)
- WHERE locktype IN ('speculative token', 'transactionid') AND pa.datname = current_database()
+ WHERE
+ locktype IN ('speculative token', 'transactionid')
+ AND pa.datname = current_database()
+ AND pa.application_name LIKE 'isolation/insert-conflict-specconflict-s%'
ORDER BY 1, 2, 3, 4;
application_namelocktype mode granted
@@ -380,7 +383,10 @@ step s2_upsert: <... completed>
step controller_print_speculative_locks:
SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid)
- WHERE locktype IN ('speculative token', 'transactionid') AND pa.datname = current_database()
+ WHERE
+ locktype IN ('speculative token', 'transactionid')
+ AND pa.datname = current_database()
+ AND pa.application_name LIKE 'isolation/insert-conflict-specconflict-s%'
ORDER BY 1, 2, 3, 4;
application_namelocktype mode granted
@@ -399,7 +405,10 @@ k1 inserted s2 with conflict update s1
step controller_print_speculative_locks:
SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid)
- WHERE locktype IN ('speculative token', 'transactionid') AND pa.datname = current_database()
+ WHERE
+ locktype IN ('speculative token', 'transactionid')
+ AND pa.datname = current_database()
+ AND pa.application_name LIKE 'isolation/insert-conflict-specconflict-s%'
ORDER BY 1, 2, 3, 4;
application_namelocktype mode granted
diff --git a/src/test/isolation/specs/insert-conflict-specconflict.spec b/src/test/isolation/specs/insert-conflict-specconflict.spec
index 6b8810919d9..2572072c9e6 100644
--- a/src/test/isolation/specs/insert-conflict-specconflict.spec
+++ b/src/test/isolation/specs/insert-conflict-specconflict.spec
@@ -63,7 +63,10 @@ step "controller_show_count" {SELECT COUNT(*) FROM upserttest; }
step "controller_print_speculative_locks" {
SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid)
- WHERE locktype IN ('speculative token', 'transactionid') AND pa.datname = current_database()
+ WHERE
+ locktype IN ('speculative token', 'transactionid')
+ AND pa.datname = current_database()
+ AND pa.application_name LIKE 'isolation/insert-conflict-specconflict-s%'
ORDER BY 1, 2, 3, 4;
}