On Wed, Apr 6, 2022 at 11:28 AM Amit Kapila <amit.kapil...@gmail.com> wrote: > > On Wed, Apr 6, 2022 at 11:09 AM wangw.f...@fujitsu.com > <wangw.f...@fujitsu.com> wrote: > > > > According to your suggestion, improve the patch to make it more generic. > > Attach the new patch. > > > > typedef void (*LogicalOutputPluginWriterUpdateProgress) (struct > LogicalDecodingContext *lr, > XLogRecPtr Ptr, > TransactionId xid, > - bool skipped_xact > + bool skipped_xact, > + bool last_write > > In this approach, I don't think we need an additional parameter > last_write. Let's do the work related to keepalive without a > parameter, do you see any problem with that? >
I think this patch doesn't take into account that we call OutputPluginUpdateProgress() from APIs like pgoutput_commit_txn(). I think we should always call the new function update_progress from those existing call sites and arrange the function such that when called from xact end APIs like pgoutput_commit_txn(), it always call OutputPluginUpdateProgress and make changes_count as 0. -- With Regards, Amit Kapila.