Re: Avoid streaming the transaction which are skipped (in corner cases)

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Avoid streaming the transaction which are skipped (in corner cases)
Date: 2022-11-26 11:25:49
Message-ID: CAA4eK1+a4muLmNdJMMC8LOSKREKNp58eCbL6spJWBYm9FYXwuw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Nov 26, 2022 at 10:59 AM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> On Fri, Nov 25, 2022 at 4:04 PM Ashutosh Bapat
> <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> wrote:
> >
> > Excellent catch. We were looking at this code last week and wondered
> > the purpose of this abort. Probably we should have some macro or
> > function to decided whether to skip a transaction based on log record.
> > That will avoid using different values in different places.
>
> We do have a common function i.e. SnapBuildXactNeedsSkip() but there
> are two problems 1) it has a dependency on the input parameter so the
> result may vary based on the input 2) this is only checked based on
> the LSN but there are other factors dbid and originid based on those
> also transaction could be skipped during DecodeCommit. So I think one
> possible solution could be to remember a dbid and originid in
> ReorderBufferTXN as soon as we get the first change which has valid
> values for these parameters.
>

But is the required information say 'dbid' available in all records,
for example, what about XLOG_XACT_INVALIDATIONS? The other thing to
consider in this regard is if we are planning to have additional
information as mentioned by me in another to decide whether to stream
or not then the additional checks may be redundant anyway. It is a
good idea to have a common check at both places but if not, we can at
least add some comments to say why the check is different.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2022-11-26 11:38:11 Re: postgres_fdw: batch inserts vs. before row triggers
Previous Message Ian Lawrence Barwick 2022-11-26 11:04:55 Re: [PATCH] Allow specification of custom slot for custom nodes