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

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Michael Banck <michael(dot)banck(at)credativ(dot)de>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Create replication slot in pg_basebackup if requested and not yet present
Date: 2017-09-06 16:22:22
Message-ID: 20521d19-f6c6-3642-caeb-73367133db76@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 8/18/17 05:28, Michael Banck wrote:
>>> Rebased, squashed and slighly edited version attached. I've added this
>>> to the 2017-07 commitfest now as well:
>>>
>>> https://commitfest.postgresql.org/14/1112/
>> Can you rebase this past some conflicting changes?
> Thanks for letting me know, PFA a rebased version.

I have reviewed the thread so far. I think there is general agreement
that something like this would be good to have.

I have not found any explanation, however, why the "if not exists"
behavior is desirable, let alone as the default. I can only think of
two workflows here: Either you have scripts for previous PG versions
that create the slot externally, in which can you omit --create, or you
use the new functionality to have pg_basebackup create the slot. I
don't see any use for pg_basebackup to opportunistically use a slot if
it happens to exist. Even if there is one, it should not be the
default. So please change that.

A minor point, I suggest to print the message about the replication slot
being created *after* the slot has been created. This aligns with how
logical replication subscriptions work. I don't see the need for
printing a message about temporary slots. Since they are temporary,
they will go away automatically, so there is nothing the user needs to
know there.

With these two changes, I think I'd be content with this patch.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2017-09-06 16:26:21 Re: Patch: Add --no-comments to skip COMMENTs with pg_dump
Previous Message Dilip Kumar 2017-09-06 16:17:51 Re: UPDATE of partition key