Commit 997563df authored by Andres Freund's avatar Andres Freund

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
43e08419). Which does indeed seem quite possible.

Avoid the problem by only looking for the backends participating in
the test.
parent dcdbb5a5
...@@ -361,7 +361,10 @@ s1: NOTICE: acquiring advisory lock on 2 ...@@ -361,7 +361,10 @@ s1: NOTICE: acquiring advisory lock on 2
step controller_print_speculative_locks: step controller_print_speculative_locks:
SELECT pa.application_name, locktype, mode, granted SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid) 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; ORDER BY 1, 2, 3, 4;
application_namelocktype mode granted application_namelocktype mode granted
...@@ -380,7 +383,10 @@ step s2_upsert: <... completed> ...@@ -380,7 +383,10 @@ step s2_upsert: <... completed>
step controller_print_speculative_locks: step controller_print_speculative_locks:
SELECT pa.application_name, locktype, mode, granted SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid) 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; ORDER BY 1, 2, 3, 4;
application_namelocktype mode granted application_namelocktype mode granted
...@@ -399,7 +405,10 @@ k1 inserted s2 with conflict update s1 ...@@ -399,7 +405,10 @@ k1 inserted s2 with conflict update s1
step controller_print_speculative_locks: step controller_print_speculative_locks:
SELECT pa.application_name, locktype, mode, granted SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid) 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; ORDER BY 1, 2, 3, 4;
application_namelocktype mode granted application_namelocktype mode granted
......
...@@ -63,7 +63,10 @@ step "controller_show_count" {SELECT COUNT(*) FROM upserttest; } ...@@ -63,7 +63,10 @@ step "controller_show_count" {SELECT COUNT(*) FROM upserttest; }
step "controller_print_speculative_locks" { step "controller_print_speculative_locks" {
SELECT pa.application_name, locktype, mode, granted SELECT pa.application_name, locktype, mode, granted
FROM pg_locks pl JOIN pg_stat_activity pa USING (pid) 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; ORDER BY 1, 2, 3, 4;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment