Re: [HACKERS] Logical decoding on standby - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [HACKERS] Logical decoding on standby
Date
Msg-id 20170322161736.day5e6eyq32ixx7n@alap3.anarazel.de
Whole thread Raw
In response to Re: [HACKERS] Logical decoding on standby  (Simon Riggs <simon.riggs@2ndquadrant.com>)
Responses Re: [HACKERS] Logical decoding on standby  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
On 2017-03-22 15:59:42 +0000, Simon Riggs wrote:
> On 22 March 2017 at 13:06, Andres Freund <andres@anarazel.de> wrote:
> 
> >> The parts I think are important for Pg10 are:
> >
> >> * Ability to create logical slots on replicas
> >
> > Doesn't this also imply recovery conflicts on DROP DATABASE?
> 
> Not needed until the slot is in use, which is a later patch.

Hm? We need to drop slots, if they can exist / be created, on a standby,
and they're on a dropped database.  Otherwise we'll reserve resources,
while anyone connecting to the slot will likely just receive errors
because the database doesn't exist anymore.  It's also one of the
patches that can quite easily be developed / reviewed, because there
really isn't anything complicated about it.  Most of the code is already
in Craig's patch, it just needs some adjustments.


> > Besides,
> > allowing to drop all slots using a database upon DROP DATABASE, is a
> > useful thing on its own.
> 
> Sure but that's a separate feature unrelated to this patch and we're
> running out of time.

Hm? The patch implemented it.


> >> * Ability to advance (via feedback or via SQL function) - no need to
> >> actually decode and call output plugins at al
> >
> > That pretty much requires decoding, otherwise you really don't know how
> > much WAL you have to retain.
> 
> Knowing how much WAL to retain is key.
> 
> Why would decoding tell you how much WAL to retain?

Because decoding already has the necessary logic?  (You need to retain
enough WAL to restart decoding for all in-progress transactions etc).


> We tried to implement this automatically from the master, which was
> rejected. So the only other way is manually. We need one or the other.

I think the current approach is roughly the right way - but that doesn't
make the patch ready.



Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] increasing the default WAL segment size
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] exposing wait events for non-backends (was: Trackingwait event for latches)