On Thu, Feb 23, 2023 at 5:40 PM Hayato Kuroda (Fujitsu) <kuroda.hay...@fujitsu.com> wrote: > > Thank you for reviewing! PSA new version. >
I was trying to think if there is any better way to implement the newly added callback (WalSndDelay()) but couldn't find any. For example, one idea I tried to evaluate is whether we can merge it with the existing callback WalSndUpdateProgress() or maybe extract the part other than progress tracking from that function into a new callback and then try to reuse it here as well. Though there is some common functionality like checking for timeout and processing replies still they are different enough that they seem to need separate callbacks. The prime purpose of a callback for the patch being discussed here is to delay the xact before sending the commit/prepare whereas the existing callback (WalSndUpdateProgress()) or what we are discussing at [1] allows sending the keepalive message in some special cases where there is no communication between walsender and walreceiver. Now, the WalSndDelay() also tries to check for timeout and send keepalive if necessary but there is also dependency on the delay parameter, so don't think it is a good idea of trying to combine those functionalities into one API. Thoughts? [1] - https://www.postgresql.org/message-id/20230210210423.r26ndnfmuifie4f6%40awork3.anarazel.de -- With Regards, Amit Kapila.