Re: [HACKERS] Logical decoding on standby

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: sanyam jain <sanyamjain22(at)live(dot)in>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Simon Riggs <simon(dot)riggs(at)2ndquadrant(dot)com>, Thom Brown <thom(at)linux(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Logical decoding on standby
Date: 2017-12-08 08:03:48
Message-ID: CAMsr+YHQxUFJyDBMob2L_tDKLnrcozivZQDvD45R=P6BUXckCw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 27 June 2017 at 13:24, Craig Ringer <craig(at)2ndquadrant(dot)com> wrote:

> On 21 June 2017 at 17:30, sanyam jain <sanyamjain22(at)live(dot)in> wrote:
> > Hi,
> > After changing
> > sendTimeLineIsHistoric = state->currTLI == ThisTimeLineID;
> > to
> > sendTimeLineIsHistoric = state->currTLI != ThisTimeLineID;
> >
> > I was facing another issue.
> > On promotion of a cascaded server ThisTimeLineID in the standby server
> > having logical slot becomes 0.
> > Then i added a function call to GetStandbyFlushRecPtr in
> > StartLogicalReplication which updates ThisTimeLineID.
> >
> > After the above two changes timeline following is working.But i'm not
> sure
> > whether this is correct or not.In any case please someone clarify.
>
> That's a reasonable thing to do, and again, I thought I did it in a
> later revision, but apparently not (?). I've been working on other
> things and have lost track of progress here a bit.
>
> I'll check more closely.
>
>
Hi all.

I've had to backburner this due to other work. In the process of looking
into an unrelated bug recently though, I noticed that the way we handle
snapshots may not be safe for historic snaphots on a standby. Historic
snapshots don't ever set takenDuringRecovery, which allows heapgetpage to
trust PD_IS_VISIBLE on a page. According to comments on heapgetpage that
could be an issue.

Minor compared to some of the other things that'll come up when finishing
this off, but worth remembering.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2017-12-08 08:20:10 Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager
Previous Message Jakub Glapa 2017-12-08 07:59:07 Re: ERROR: too many dynamic shared memory segments