Re: Initial table sync copies the whole table when it is no longer published

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Ajin Cherian <itsajin(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, vignesh C <vignesh21(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, shveta malik <shvetamalik(at)gmail(dot)com>
Subject: Re: Initial table sync copies the whole table when it is no longer published
Date: 2026-11-18 23:02:19
Message-ID: CAHut+PuFfdGFxOH1p=M7r+wt7+aZ7e6nK3gH1kL5g89OFgTHbw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Shveta.

Patch v3-0001 is unchanged, so it still LGTM.

Below are some comments for v3-0002 (docs).

======
src/sgml/ref/create_subscription.sgml

1.
+ <note>
+ <para>
+ If the error persists, the subscription is disabled again as soon
+ as it is re-enabled. For example, if initial table synchronization
+ fails because the table was dropped on the publisher or removed
+ from the publication,
+ <link
linkend="sql-altersubscription-params-refresh-publication"><command>ALTER
SUBSCRIPTION ... REFRESH PUBLICATION</command></link>
+ is needed to remove it from the subscription. However, this
+ command is not allowed while the subscription is disabled. ...

IMO the "For example" doesn't seem to illustrate the preceding
sentence. The sentence says the subscription keeps getting disabled,
but the example jumps straight to a cause (table dropped/unpublished)
and then to the fix (REFRESH PUBLICATION). It never says that this is
a case where the error recurs, so the subscription keeps disabling
itself.

There're a couple of other minor nits -- e.g. "as soon as it is
re-enabled" is not quite accurate. The subscription is only disabled
again after the worker hits the error again, not at the moment it is
enabled.

My LLM came up with some reworded text split into example and
workaround paragraphs, which I think is better.

SUGGESTION

<note>
<para>
If the underlying cause is not resolved, the subscription is disabled again
shortly after it is re-enabled. For example, if initial table
synchronization fails because the table was dropped on the publisher or
removed from the publication, the same error recurs each time the
synchronization is retried.
</para>
<para>
In that case,
<link linkend="sql-altersubscription-params-refresh-publication"><command>ALTER
SUBSCRIPTION ... REFRESH PUBLICATION</command></link>
is needed to remove the table from the subscription, but it cannot be run
while the subscription is disabled. To work around this, either fix the
cause on the publisher before re-enabling the subscription, or temporarily
set <literal>disable_on_error</literal> to <literal>false</literal>,
re-enable the subscription using
<link linkend="sql-altersubscription-params-enable"><command>ALTER
SUBSCRIPTION ... ENABLE</command></link>,
run <command>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</command>, and then
set <literal>disable_on_error</literal> back to <literal>true</literal>.
</para>
</note>

~~~

2.
But is this the best place for describing the disable_on_error
workaround? A user who hits the REFRESH PUBLICATION restriction is
probably going to be looking at the ALTER SUBSCRIPTION docs, so maybe
the workaround details belong there?

======
Kind Regards,
Peter Smith.
Fujitsu Australia

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-11-18 23:08:25 Re: [PATCH] Fix encoding-dependent LIKE/regex selectivity estimates
Previous Message Melanie Plageman 2026-11-18 22:45:54 Re: Fix ReadStream handling when heap rescan strategy changes