pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Gerard H. Pille <ghpille@hotmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: pg_basebackup behavior on non-existent slot
Date: Mon, 23 Aug 2021 16:11:12 +0900
Message-ID: <YSNKEJFmA+amz515@paquier.xyz> (raw)
In-Reply-To: <CAD21AoA=D1ssWr-GOPz-NMr4jDsZb2VGetdRVvXeQXtdiLoBUA@mail.gmail.com>
References: <PA4PR04MB78886C76F521F031FDEB216CBCC29@PA4PR04MB7888.eurprd04.prod.outlook.com>
	<CAD21AoA=D1ssWr-GOPz-NMr4jDsZb2VGetdRVvXeQXtdiLoBUA@mail.gmail.com>

On Mon, Aug 23, 2021 at 12:54:58PM +0900, Masahiko Sawada wrote:
> On Sat, Aug 21, 2021 at 10:15 PM Gerard H. Pille <ghpille@hotmail.com> wrote:
>> The old thread:
>> https://postgrespro.com/list/thread-id/2337189#CAMkU=1wSxYBNFY9TzuVh3=mDLr4BBsMct6wcViNMH+-6Xon4Uw@m...

A link to postgresql.org does the same work:
https://www.postgresql.org/message-id/CAMkU=1wSxYBNFY9TzuVh3=mDLr4BBsMct6wcViNMH+-6Xon4Uw@mail.gmail...
No need to redirect that elsewhere.

> It seems it's not fixed yet even in HEAD as far as I tested. There
> were some ideas to fix that on that thread but the main point was how
> to fix it on Windows. I guess that since it creates a transient slot
> it’s not a common case to specify a non-existence slot in pg_baseback
> but what is your use case? This might help motivate to fix this issue.
> 
> BTW in that thread, there was a discussion on how to detect the
> streamer process failure in the main process but probably we can fix
> this by just doing an existence check for the specified name
> replication slot before starting the streamer process?

Yeah.  Honestly, I am not really excited to redesign this part of base
backups just to take care of a side problem that is mitigated for most 
users with the use of a temporary slot.  It would be simpler, as you
say, to find a way to detect if the slot wanted exists before even
launching START_REPLICATION with the specified slot on the second
thread copying the WAL, but that would be a new thing as one cannot do
catalog lookups with a physical replication session.  Some ideas here
may be to extend the result of IDENTIFY_SYSTEM to return the slots
available in a text array, invent a new command called SLOT, use SHOW
or perhaps do an extra CREATE_REPLICATION_SLOT TEMPORARY from the main
thread.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (12+ messages)  latest in thread

Message-ID: <YSNKEJFmA+amz515@paquier.xyz>
Permalink:  ../YSNKEJFmA+amz515@paquier.xyz/
Also on:    postgresql.org/message-id/YSNKEJFmA+amz515@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, sawada.mshk@gmail.com, ghpille@hotmail.com
  Subject: Re: pg_basebackup behavior on non-existent slot
  In-Reply-To: <YSNKEJFmA+amz515@paquier.xyz>
  References: <PA4PR04MB78886C76F521F031FDEB216CBCC29@PA4PR04MB7888.eurprd04.prod.outlook.com> <CAD21AoA=D1ssWr-GOPz-NMr4jDsZb2VGetdRVvXeQXtdiLoBUA@mail.gmail.com> <YSNKEJFmA+amz515@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox