Re: logical replication empty transactions

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Ajin Cherian <itsajin(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Rahila Syed <rahila(dot)syed(at)2ndquadrant(dot)com>, Euler Taveira <euler(at)timbira(dot)com(dot)br>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Craig Ringer <craig(at)2ndquadrant(dot)com>
Subject: Re: logical replication empty transactions
Date: 2021-05-27 10:58:47
Message-ID: CALDaNm3qbdDPzPs3_zjJGTrOmrVx0kLRrYPhUp1WNzem1c=T0g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 25, 2021 at 6:36 PM Ajin Cherian <itsajin(at)gmail(dot)com> wrote:
>
> On Tue, Apr 27, 2021 at 1:49 PM Ajin Cherian <itsajin(at)gmail(dot)com> wrote:
>
> Rebased the patch as it was no longer applying.

Thanks for the updated patch, few comments:
1) I'm not sure if we could add some tests for skip empty
transactions, if possible add a few tests.

2) We could add some debug level log messages for the transaction that
will be skipped.

3) You could keep this variable below the other bool variables in the structure:
+ bool sent_begin_txn; /* flag indicating whether begin
+
* has already been sent */
+

4) You can split the comments to multi-line as it exceeds 80 chars
+ /* output BEGIN if we haven't yet, avoid for streaming and
non-transactional messages */
+ if (!data->sent_begin_txn && !in_streaming && transactional)
+ pgoutput_begin(ctx, txn);

Regards,
Vignesh

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message houzj.fnst@fujitsu.com 2021-05-27 11:11:59 RE: Parallel Inserts in CREATE TABLE AS
Previous Message Amit Kapila 2021-05-27 10:26:33 Re: Skipping logical replication transactions on subscriber side