Re: pg_decode_message vs skip_empty_xacts and xact_wrote_changes

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_decode_message vs skip_empty_xacts and xact_wrote_changes
Date: 2023-06-29 04:05:34
Message-ID: CALDaNm0fWoS7eX9o3iVq8NwynpvAKKFK0YPEXWDTgBEOOjvFkw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 28 Jun 2023 at 19:26, Ashutosh Bapat
<ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> wrote:
>
> Hi Vignesh,
> Thanks for working on this.
>
> On Wed, Jun 28, 2023 at 4:52 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> >
> > Here is a patch having the fix for the same. I have not added any
> > tests as the existing tests cover this scenario. The same issue is
> > present in back branches too.
>
> Interesting, we have a test for this scenario and it accepts erroneous
> output :).
>
> > v1-0001-Call-pg_output_begin-in-pg_decode_message-if-it-i_master.patch
> > can be applied on master, PG15 and PG14,
> > v1-0001-Call-pg_output_begin-in-pg_decode_message-if-it-i_PG13.patch
> > patch can be applied on PG13, PG12 and PG11.
> > Thoughts?
>
> I noticed this when looking at Tomas's patches for logical decoding of
> sequences. The code block you have added is repeated in
> pg_decode_change() and pg_decode_truncate(). It might be better to
> push the conditions in pg_output_begin() itself so that any future
> callsite of pg_output_begin() automatically takes care of these
> conditions.

Thanks for the comments, here is an updated patch handling the above issue.

Regards,
Vignesh

Attachment Content-Type Size
v2-0001-Call-pg_output_begin-in-pg_decode_message-if-it-i_PG13.patch text/x-patch 4.9 KB
v2-0001-Call-pg_output_begin-in-pg_decode_message-if-it-i_PG14.patch text/x-patch 5.2 KB
v2-0001-Call-pg_output_begin-in-pg_decode_message-if-it-i_PG10.patch text/x-patch 4.5 KB
v2-0001-Call-pg_output_begin-in-pg_decode_message-if-it-i_master.patch text/x-patch 5.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gurjeet Singh 2023-06-29 04:20:03 Re: harmonize password reuse in vacuumdb, clusterdb, and reindexdb
Previous Message David Rowley 2023-06-29 03:46:47 Re: Changing types of block and chunk sizes in memory contexts