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

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: Fix src/test/subscription/t/029_on_error.pl test when wal_debug is enabled
Дата
Msg-id CAA4eK1KgaZkK6A2ex1su+YvpJB4F-EFmzMLhCV-jmwm+oBXx1Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fix src/test/subscription/t/029_on_error.pl test when wal_debug is enabled  (Michael Paquier <michael@paquier.xyz>)
Ответы RE: Fix src/test/subscription/t/029_on_error.pl test when wal_debug is enabled
Re: Fix src/test/subscription/t/029_on_error.pl test when wal_debug is enabled
Список pgsql-hackers
On Wed, May 15, 2024 at 9:26 AM Michael Paquier <michael@paquier.xyz> wrote:
>
> 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?
>

I guess it could be more work if we want to enhance the test for
ERRORs other than the primary key violation. One simple fix is to
update the log_offset to the location of the LOG after successful
replication of un-conflicted data. For example, the Log location after
we execute the below line in the test:

# Check replicated data
               my $res =
                 $node_subscriber->safe_psql('postgres', "SELECT
count(*) FROM tbl");
               is($res, $expected, $msg);

--
With Regards,
Amit Kapila.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: Converting README documentation to Markdown
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: in parentesis is not usual on DOCs