Re: Fix src/test/subscription/t/029_on_error.pl test when wal_debug is enabled

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Ilyasov Ian <ianilyasov(at)outlook(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix src/test/subscription/t/029_on_error.pl test when wal_debug is enabled
Date: 2024-05-15 03:55:56
Message-ID: ZkQyTDwFspyJ0JfJ@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 14, 2024 at 10:22:29AM +0000, Ilyasov Ian wrote:
> Hello, hackers!
>
> Recently I've been building postgres with different cflags and cppflags.
> And suddenly on REL_15_STABLE, REL_16_STABLE and master
> I faced a failure of a src/test/subscription/t/029_on_error.pl test when
>       CPPFLAGS="-DWAL_DEBUG"
> and
>       printf "wal_debug = on\n" >> "${TEMP_CONFIG}"
> (or when both publisher and subscriber or only subscriber are run with wal_debug=on)
>
> So I propose a little fix to the test.

Rather than assuming that the last line is the one to check, wouldn't
it be better to grab the data from the CONTEXT line located just after
the ERROR reporting the primary key violation?

A multi-line regexp, grabbing the LSN with more matching context based
on the ERROR and the DETAIL strings generating the CONTEXT we want
seems like a more stable alternative to me than grabbing the last line
of the logs.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2024-05-15 04:21:25 Re: Requiring LLVM 14+ in PostgreSQL 18
Previous Message jian he 2024-05-15 03:40:11 Re: explain format json, unit for serialize and memory are different.