Re: Time delayed LR (WAS Re: logical replication restrictions)

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: amit(dot)kapila16(at)gmail(dot)com
Cc: sawada(dot)mshk(at)gmail(dot)com, kuroda(dot)hayato(at)fujitsu(dot)com, shiy(dot)fnst(at)fujitsu(dot)com, smithpb2250(at)gmail(dot)com, andres(at)anarazel(dot)de, vignesh21(at)gmail(dot)com, shveta(dot)malik(at)gmail(dot)com, osumi(dot)takamichi(at)fujitsu(dot)com, dilipbalaut(at)gmail(dot)com, euler(at)eulerto(dot)com, m(dot)melihmutlu(at)gmail(dot)com, marcos(at)f10(dot)com(dot)br, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Time delayed LR (WAS Re: logical replication restrictions)
Date: 2023-02-28 02:44:46
Message-ID: 20230228.114446.1194167913927301604.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Mon, 27 Feb 2023 14:56:19 +0530, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote in
> The one difference w.r.t recovery_min_apply_delay is that here we will
> hold locks for the duration of the delay which didn't seem to be a
> good idea. This will also probably lead to more bloat as we will keep
> transactions open for a long time. Doing it before DecodePrepare won't

I don't have a concrete picture but could we tell reorder buffer to
retain a PREPAREd transaction until a COMMIT PREPARED comes? If
delaying non-prepared transactions until COMMIT is adequate, then the
same thing seems to work for prepared transactions.

> have such problems. This is the reason that we decide to perform a
> delay at the start of the transaction instead at commit/prepare in the
> subscriber-side approach.

It seems that there are no technical obstacles to do that on the
publisher side. The only observable difference would be that
relatively large prepared transactions may experience noticeable
additional delays. IMHO I don't think it's a good practice
protocol-wise to intentionally choke a stream at the receiving end
when it has not been flow-controlled on the transmitting end.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2023-02-28 03:05:11 Re: Time delayed LR (WAS Re: logical replication restrictions)
Previous Message Stephen Frost 2023-02-28 02:38:35 Re: Non-superuser subscription owners