0001-Test-subscription-029_on_error.pl-fix-when-wal_debug.patch
text/x-patch
Filename: 0001-Test-subscription-029_on_error.pl-fix-when-wal_debug.patch
Type: text/x-patch
Part: 0
Patch
Format: format-patch
Series: patch 0001
Subject: Fix subscription/029_on_error.pl test when wal_debug=on
| File | + | − |
|---|---|---|
| src/test/subscription/t/029_on_error.pl | 2 | 1 |
From 74cc32fe47def995c7cd85d3685215db383d3630 Mon Sep 17 00:00:00 2001 From: Ian Ilyasov <ianilyasov@outlook.com> Date: Tue, 14 May 2024 13:08:02 +0300 Subject: [PATCH] Fix subscription/029_on_error.pl test when wal_debug=on wal_debug=on results in additional log entries. Previously we would look for the first matching line to get LSN to SKIP up to, but, with wal_debug in mind, we better look for the last matching line to make sure we won't get an error like ERROR: skip WAL location (LSN x/y) must be greater than origin LSN x/y+delta --- src/test/subscription/t/029_on_error.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/subscription/t/029_on_error.pl b/src/test/subscription/t/029_on_error.pl index 7a8e424a22e..aedcd9a6213 100644 --- a/src/test/subscription/t/029_on_error.pl +++ b/src/test/subscription/t/029_on_error.pl @@ -28,8 +28,9 @@ sub test_skip_lsn # Get the finish LSN of the error transaction. my $contents = slurp_file($node_subscriber->logfile, $offset); + # We need LSN from the last matching line to avoid getting wrong LSN with wal_debug=on $contents =~ - qr/processing remote data for replication origin \"pg_\d+\" during message type "INSERT" for replication target relation "public.tbl" in transaction \d+, finished at ([[:xdigit:]]+\/[[:xdigit:]]+)/ + qr/(?:.|\n)*processing remote data for replication origin \"pg_\d+\" during message type "INSERT" for replication target relation "public.tbl" in transaction \d+, finished at ([[:xdigit:]]+\/[[:xdigit:]]+)/ or die "could not get error-LSN"; my $lsn = $1; -- 2.34.1