Re: Create replication slot in pg_basebackup if requested and not yet present

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Michael Banck <michael(dot)banck(at)credativ(dot)de>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Create replication slot in pg_basebackup if requested and not yet present
Date: 2017-03-23 11:41:54
Message-ID: CABUevEyF=U6h6g=OJ-OuLyiEXmiJ7jphUD8vDhR6XJrbcpDpmA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 21, 2017 at 8:34 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Sun, Mar 19, 2017 at 12:01 PM, Magnus Hagander <magnus(at)hagander(dot)net>
> wrote:
> > I think maybe we should output a message when the slot is created, at
> least
> > in verbose mode, to make sure people realize that happened. Does that
> seem
> > reasonable?
>
> Slots are great until you leave one lying around by accident. I'm
> afraid that no matter what we do, we're going to start getting
> complaints from people who mess that up. For example, somebody
> creates a replica using the new super-easy method, and then blows it
> away without dropping the slot from the master, and then days or weeks
> later pg_wal fills up and takes the server down. The user says, oh,
> these old write-ahead log files should have gotten removed, and
> removes them all. Oops.

> So I tend to think that there should always be some explicit user
> action to cause the creation of a slot, like --create-slot-if-needed
> or --create-slot=name. That still won't prevent careless use of that
> option but it's less dangerous than assuming that a user who refers to
> a nonexistent slot intended to create it when, perhaps, they just
> typo'd it.
>

Well, the explicit user action would be "--slot". But sure, I can
definitely live with a --create-if-not-exists. The important thing, to me,
is that you can run it as a single command, which makes it a lot easier to
work with. (And not like we currently have for pg_receivewal which requires
a separate command to create the slot)

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2017-03-23 12:20:54 Re: postgres_fdw bug in 9.6
Previous Message Pavan Deolasee 2017-03-23 11:34:01 Re: Patch: Write Amplification Reduction Method (WARM)