Skip to content

Commit e33d004

Browse files
author
Amit Kapila
committed
Fix the test for decoding of two-phase transactions.
Commit 5a3574d added the test for decoding of two-phase transactions during the build of a consistent snapshot. The test forgot to skip empty xacts which can lead to decoding of extra empty transactions due to background activity by autovacuum. Per report by buildfarm. Reported-by: Tom Lane Discussion: https://postgr.es/m/363512.1610171267@sss.pgh.pa.us
1 parent 39d4a15 commit e33d004

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

contrib/test_decoding/expected/twophase_snapshot.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ step s1init: <... completed>
2222

2323
init
2424
step s1insert: INSERT INTO do_write DEFAULT VALUES;
25-
step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'two-phase-commit', '1');
25+
step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1', 'two-phase-commit', '1');
2626
data
2727

2828
BEGIN
2929
table public.do_write: INSERT: id[integer]:2
3030
COMMIT
3131
step s2cp: COMMIT PREPARED 'test1';
32-
step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'two-phase-commit', '1');
32+
step s1start: SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1', 'two-phase-commit', '1');
3333
data
3434

3535
BEGIN

contrib/test_decoding/specs/twophase_snapshot.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ session "s1"
1616
setup { SET synchronous_commit=on; }
1717

1818
step "s1init" {SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'test_decoding');}
19-
step "s1start" {SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'two-phase-commit', '1');}
19+
step "s1start" {SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'include-xids', 'false', 'skip-empty-xacts', '1', 'two-phase-commit', '1');}
2020
step "s1insert" { INSERT INTO do_write DEFAULT VALUES; }
2121

2222
session "s2"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy