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

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, "Takamichi Osumi (Fujitsu)" <osumi(dot)takamichi(at)fujitsu(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, "euler(at)eulerto(dot)com" <euler(at)eulerto(dot)com>, "m(dot)melihmutlu(at)gmail(dot)com" <m(dot)melihmutlu(at)gmail(dot)com>, "andres(at)anarazel(dot)de" <andres(at)anarazel(dot)de>, "marcos(at)f10(dot)com(dot)br" <marcos(at)f10(dot)com(dot)br>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "smithpb2250(at)gmail(dot)com" <smithpb2250(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: Time delayed LR (WAS Re: logical replication restrictions)
Date: 2023-01-03 11:22:08
Message-ID: CAJpy0uCNpoPrQbvy2tUxGw4aCsrCJQex-mRa_QM7bwHcq_Vokg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> On Tue, 27 Dec 2022 at 14:59, Hayato Kuroda (Fujitsu)
> <kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
> > Note that more than half of the modifications are done by Osumi-san.
>

Please find a few minor comments.
1.
+ diffms = TimestampDifferenceMilliseconds(GetCurrentTimestamp(),
+

TimestampTzPlusMilliseconds(ts, MySubscription->minapplydelay));
on unix, above code looks unaligned (copied from unix)

2. same with:
+ interval = DatumGetIntervalP(DirectFunctionCall3(interval_in,
+

CStringGetDatum(val),
+

ObjectIdGetDatum(InvalidOid),
+

Int32GetDatum(-1)));
perhaps due to tabs?

2. comment not clear:
+ * During the time delayed replication, avoid reporting the suspended
+ * latest LSN are already flushed and written, to the publisher.

3.
+ * Call send_feedback() to prevent the publisher from exiting by
+ * timeout during the delay, when wal_receiver_status_interval is
+ * available. The WALs for this delayed transaction is neither
+ * written nor flushed yet, Thus, we don't make the latest LSN
+ * overwrite those positions of the update message for this delay.

yet, Thus, we --> yet, thus, we/ yet. Thus, we

4.
+ /* Adds portion time (in ms) to the previous result. */
+ ms = interval->time / INT64CONST(1000);
Is interval->time always in micro-seconds here?

Thanks
Shveta

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2023-01-03 12:00:09 Re: Data loss on logical replication, 12.12 to 14.5, ALTER SUBSCRIPTION
Previous Message Pavel Borisov 2023-01-03 11:20:38 Re: Allow placeholders in ALTER ROLE w/o superuser