Re: replication_origin and replication_origin_lsn usage on subscriber

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Petr Jelinek <petr(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, movead(dot)li(at)highgo(dot)ca, Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: Re: replication_origin and replication_origin_lsn usage on subscriber
Date: 2020-07-14 06:34:56
Message-ID: CAFiTN-vjWGvwRsuzdU=g6axh3uH1rzhygfJ=L827fs-3MLA+QQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 14, 2020 at 11:14 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Tue, Jul 14, 2020 at 11:00 AM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> >
> > On Thu, Jul 9, 2020 at 6:55 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> > >
> > > On Thu, Jul 9, 2020 at 6:14 PM Petr Jelinek <petr(at)2ndquadrant(dot)com> wrote:
> > > >
> > > >
> > > > If we were to support the origin forwarding, then strictly speaking we
> > > > need everything only at commit time from correctness perspective,
> > > >
> > >
> > > Okay. Anyway streaming mode is optional, so in such cases, we can keep it 'off'
> > >
> > > > but
> > > > ideally origin_id would be best sent with first message as it can be
> > > > used to filter out changes at decoding stage rather than while we
> > > > process the commit so having it set early improves performance of decoding.
> > > >
> > >
> > > Yeah, makes sense. So, we will just send origin_id (with first
> > > streaming start message) and leave others.
> >
> > So IIUC, currently we are sending the latest origin_id which is set
> > during the commit time. So in our case, while we start streaming we
> > will send the origin_id of the latest change in the current stream
> > right?
> >
>
> It has to be sent only once with the first start message not with
> consecutive start messages.

Okay, so do you mean to say that with the first start message we send
the origin_id of the latest change? because during the transaction
lifetime, the origin id can be changed. Currently, we send the
origin_id of the latest WAL i.e. origin id of the commit. so I think
it will be on a similar line if with every stream_start we send the
origin_id of the latest change in that stream.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amul Sul 2020-07-14 06:37:28 Re: [Patch] ALTER SYSTEM READ ONLY
Previous Message Pavel Stehule 2020-07-14 06:32:41 Re: proposal: possibility to read dumped table's name from file