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

Avoid the problem by only looking for the backends participating in
the test.
This commit is contained in:
Andres Freund 2020-02-11 21:14:08 -08:00
parent dcdbb5a5db
commit 997563dfcb
2 changed files with 16 additions and 4 deletions

View File

@ -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

View File

@ -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;
}