Re: Time delayed LR (WAS Re: logical replication restrictions) - Mailing list pgsql-hackers

From shveta malik
Subject Re: Time delayed LR (WAS Re: logical replication restrictions)
Date
Msg-id CAJpy0uCNpoPrQbvy2tUxGw4aCsrCJQex-mRa_QM7bwHcq_Vokg@mail.gmail.com
Whole thread Raw
In response to Re: Time delayed LR (WAS Re: logical replication restrictions)  (vignesh C <vignesh21@gmail.com>)
Responses RE: Time delayed LR (WAS Re: logical replication restrictions)
List pgsql-hackers
>
> On Tue, 27 Dec 2022 at 14:59, Hayato Kuroda (Fujitsu)
> <kuroda.hayato@fujitsu.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



pgsql-hackers by date:

Previous
From: Pavel Borisov
Date:
Subject: Re: Allow placeholders in ALTER ROLE w/o superuser
Next
From: Amit Kapila
Date:
Subject: Re: Data loss on logical replication, 12.12 to 14.5, ALTER SUBSCRIPTION