Re: Add an option to skip loading missing publication to avoid logical replication failure

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Dilip Kumar <dilipbalaut(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add an option to skip loading missing publication to avoid logical replication failure
Date: 2025-04-30 05:52:13
Message-ID: 1230066.1745992333@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> writes:
> Thanks, Dilip and Sawada-San, for the inputs, and Vignesh for the
> patch. I have pushed the change.

Xuneng Zhou pointed out on Discord that the test case added by
7c99dc587 has caused repeated failures in CI --- though oddly,
it's not failed in the buildfarm so far as I can find. The
failures look like

timed out waiting for match: (?^:WARNING: ( [A-Z0-9]+:)? skipped loading publication: tap_pub_3) at /tmp/cirrus-ci-build/src/test/subscription/t/024_add_drop_pub.pl line 103.

I suspect that what is happening is that the "skipped loading
publication" message comes out sooner than the 024 test script
expects, and thus that it could be fixed by moving the
"my $offset = -s $node_publisher->logfile;" line to be just
before the ALTER SUBSCRIPTION command instead of just after it.
Because the "skipped" message is from LoadPublications() which
is fundamentally invoked as a result of cache flushes, it's
hardly astonishing that its timing would be erratic.

However, I can't really prove this because I've been unable
to reproduce the failure locally, except by moving the
"my $offset" assignment further down which is surely cheating.

Thoughts?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2025-04-30 05:52:51 Re: Persist injection points across server restarts
Previous Message Michael Paquier 2025-04-30 05:35:40 Persist injection points across server restarts