mirror of
https://github.com/postgres/postgres.git
synced 2026-10-23 13:29:09 +03:00
Stabilize repack_decode isolation test.
Commit 7164dcb665 added the repack_decode isolation test, whose
s1_decode step counts every change decoded from the slot. A concurrent
autovacuum transaction that modifies only system catalogs is decoded
as an empty BEGIN/COMMIT pair, so the count could come out larger
than expected.
Fix by passing skip-empty-xacts to test_decoding. We pass it, along
with include-xids=0, to s1_decode_updates as well so that both steps
use the same options for consistency, though that step shows only
UPDATE lines and wasn't affected.
Per buildfarm animal skink.
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/d704cde4-b1f2-48dc-8c5e-659d1128d286@gmail.com
Backpatch-through: 19
This commit is contained in:
@@ -22,11 +22,12 @@ injection_points_wakeup
|
||||
|
||||
step s1_wait_before_lock: <... completed>
|
||||
step s1_decode:
|
||||
SELECT count(*) FROM pg_logical_slot_peek_changes('s', NULL, NULL, 'include-rewrites', '1');
|
||||
SELECT count(*) FROM pg_logical_slot_peek_changes('s', NULL, NULL, 'include-rewrites', '1',
|
||||
'skip-empty-xacts', '1', 'include-xids', '0');
|
||||
|
||||
count
|
||||
-----
|
||||
8
|
||||
6
|
||||
(1 row)
|
||||
|
||||
injection_points_detach
|
||||
@@ -62,7 +63,8 @@ injection_points_wakeup
|
||||
|
||||
step s1_wait_before_lock: <... completed>
|
||||
step s1_decode_updates:
|
||||
SELECT data FROM pg_logical_slot_peek_changes('s', NULL, NULL, 'include-rewrites', '1')
|
||||
SELECT data FROM pg_logical_slot_peek_changes('s', NULL, NULL, 'include-rewrites', '1',
|
||||
'skip-empty-xacts', '1', 'include-xids', '0')
|
||||
WHERE data LIKE '%UPDATE%';
|
||||
|
||||
data
|
||||
|
||||
@@ -40,13 +40,15 @@ step s1_wait_before_lock
|
||||
}
|
||||
step s1_decode
|
||||
{
|
||||
SELECT count(*) FROM pg_logical_slot_peek_changes('s', NULL, NULL, 'include-rewrites', '1');
|
||||
SELECT count(*) FROM pg_logical_slot_peek_changes('s', NULL, NULL, 'include-rewrites', '1',
|
||||
'skip-empty-xacts', '1', 'include-xids', '0');
|
||||
}
|
||||
# Show the decoded updates. The row loaded by setup carries a random TOAST
|
||||
# value, so only the updates are stable enough to display.
|
||||
step s1_decode_updates
|
||||
{
|
||||
SELECT data FROM pg_logical_slot_peek_changes('s', NULL, NULL, 'include-rewrites', '1')
|
||||
SELECT data FROM pg_logical_slot_peek_changes('s', NULL, NULL, 'include-rewrites', '1',
|
||||
'skip-empty-xacts', '1', 'include-xids', '0')
|
||||
WHERE data LIKE '%UPDATE%';
|
||||
}
|
||||
teardown
|
||||
|
||||
Reference in New Issue
Block a user