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

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Ilyasov Ian <ianilyasov@outlook.com>
Cc: "amit.kapila16@gmail.com" <amit.kapila16@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, "a.voloshin@postgrespro.ru" <a.voloshin@postgrespro.ru>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2024-05-24T02:24:03Z
Lists: pgsql-hackers
On Thu, May 23, 2024 at 08:12:07AM +0000, Ilyasov Ian wrote:
> > It seems to me that we should keep the 'for replication target relation
> "public.tbl" in transaction \d+,', before the "finished at" so as it
> is possible to make a difference with the context that has a column
> name and the context where there is no target relation.
> 
> I agree. Attached the updated patch.

One issue that you have here is that the regexp detection would still
fail when setting log_error_verbosity = verbose because of the extra
error code added between the ERROR and the string.  This caused the
LSN to not be fetched properly.

At the end, I've come up with a regexp that checks for a match of the
error string after the ERROR to not confuse the last part getting the
xdigits, and applied that down to 15.  Perhaps I would have added the
first "ERROR" part in the check, but could not come down to it for the
readability of the thing.
--
Michael

Commits

  1. Improve stability of subscription/029_on_error.pl