RE: Optionally automatically disable logical replication subscriptions on error - Mailing list pgsql-hackers

From wangw.fnst@fujitsu.com
Subject RE: Optionally automatically disable logical replication subscriptions on error
Date
Msg-id OS3PR01MB6275C137E5032EC46290DB319E439@OS3PR01MB6275.jpnprd01.prod.outlook.com
Whole thread Raw
In response to RE: Optionally automatically disable logical replication subscriptions on error  ("osumi.takamichi@fujitsu.com" <osumi.takamichi@fujitsu.com>)
Responses RE: Optionally automatically disable logical replication subscriptions on error  ("osumi.takamichi@fujitsu.com" <osumi.takamichi@fujitsu.com>)
List pgsql-hackers
On Thursday, December 16, 2021 8:51 PM osumi.takamichi@fujitsu.com <osumi.takamichi@fujitsu.com> wrote:
> Attached the updated patch v14.

A comment to the timing of printing a log:
After the log[1] was printed, I altered subscription's option
(DISABLE_ON_ERROR) from true to false before invoking DisableSubscriptionOnError
to disable subscription. Subscription was not disabled.
[1] "LOG:  logical replication subscription "sub1" will be disabled due to an error"

I found this log is printed in function WorkerErrorRecovery:
+    ereport(LOG,
+            errmsg("logical replication subscription \"%s\" will be disabled due to an error",
+                   MySubscription->name));
This log is printed here, but in DisableSubscriptionOnError, there is a check to
confirm subscription's disableonerr field. If disableonerr is found changed from
true to false in DisableSubscriptionOnError, subscription will not be disabled.

In this case, "disable subscription" is printed, but subscription will not be
disabled actually.
I think it is a little confused to user, so what about moving this message after
the check which is mentioned above in DisableSubscriptionOnError?


Regards,
Wang wei

pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Can there ever be out of sequence WAL files?
Next
From: Bharath Rupireddy
Date:
Subject: Re: Add checkpoint and redo LSN to LogCheckpointEnd log message