RE: Skipping logical replication transactions on subscriber side - Mailing list pgsql-hackers

From tanghy.fnst@fujitsu.com
Subject RE: Skipping logical replication transactions on subscriber side
Date
Msg-id OS0PR01MB6113BA54DD3D8D086DC87559FB5E9@OS0PR01MB6113.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Skipping logical replication transactions on subscriber side  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Fri, Jan 21, 2022 7:55 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> 
> 2.
> +stop_skipping_changes(bool clear_subskipxid, XLogRecPtr origin_lsn,
> +   TimestampTz origin_timestamp)
> +{
> + Assert(is_skipping_changes());
> +
> + ereport(LOG,
> + (errmsg("done skipping logical replication transaction %u",
> + skip_xid)));
> 
> Isn't it better to move this LOG at the end of this function? Because
> clear* functions can give an error, so it is better to move it after
> that. I have done that in the attached.
> 

+    /* Stop skipping changes */
+    skip_xid = InvalidTransactionId;
+
+    ereport(LOG,
+            (errmsg("done skipping logical replication transaction %u",
+                    skip_xid)));


I think we can move the LOG before resetting skip_xid, otherwise skip_xid would
always be 0 in the LOG.

Regards,
Tang

pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: row filtering for logical replication
Next
From: Peter Smith
Date:
Subject: Re: row filtering for logical replication