On Wed, Sep 13, 2023 at 4:54 PM shveta malik <shveta.ma...@gmail.com> wrote: > > PFA v17. It has below changes: >
@@ -2498,6 +2500,13 @@ ReorderBufferProcessTXN(ReorderBuffer *rb, ReorderBufferTXN *txn, } else { + /* + * Before we send out the last set of changes to logical decoding + * output plugin, wait for specified streaming replication standby + * servers (if any) to confirm receipt of WAL upto commit_lsn. + */ + WaitForStandbyLSN(commit_lsn); It seems the first patch has a wait logic for every commit. I think it is better to integrate this wait with WalSndWaitForWal() as suggested by Andres in his email[1]. [1] - https://www.postgresql.org/message-id/20220207204557.74mgbhowydjco4mh%40alap3.anarazel.de -- With Regards, Amit Kapila.