Re: Force streaming every change in logical decoding

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: "shiy(dot)fnst(at)fujitsu(dot)com" <shiy(dot)fnst(at)fujitsu(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Force streaming every change in logical decoding
Date: 2022-12-20 05:18:39
Message-ID: CAFiTN-vStPYB48vZkjF=4NpMzThTfme=DBm1g+0cRghthxAPMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 14, 2022 at 2:15 PM shiy(dot)fnst(at)fujitsu(dot)com
<shiy(dot)fnst(at)fujitsu(dot)com> wrote:

> > - while (rb->size >= logical_decoding_work_mem * 1024L)
> > + while ((!force_stream && rb->size >= logical_decoding_work_mem *
> > 1024L) ||
> > + (force_stream && rb->size > 0))
> > {
> >
> > It seems like if force_stream is on then indirectly it is enabling
> > force serialization as well. Because once we enter into the loop
> > based on "force_stream" then it will either stream or serialize but I
> > guess we do not want to force serialize based on this parameter.
> >
>
> Agreed, I refactored the code and modified this point.

After thinking more on this I feel the previous behavior made more
sense. Because without this patch if we cross the work_mem we try to
stream and if we can not stream for some reason e.g. partial change
then we serialize. And I feel your previous patch was mimicking the
same behavior for each change. Now in the new patch, we will try to
stream and if we can not we will queue the change so I feel we are
creating a new patch that actually doesn't exist without the force
mode.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2022-12-20 05:22:23 Re: Force streaming every change in logical decoding
Previous Message Amit Kapila 2022-12-20 05:05:52 Re: Time delayed LR (WAS Re: logical replication restrictions)