Re: Re: [GENERAL] pg_basebackup error: replication slot "pg_basebackup_2194" already exists

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Ludovic Vaugeois-Pepin <ludovicvp(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [GENERAL] pg_basebackup error: replication slot "pg_basebackup_2194" already exists
Date: 2017-05-31 18:09:55
Message-ID: CAB7nPqS0z5seabtVZfDeuRzYyxwx2E+r4mjAM7G5+ks0FcP45Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Wed, May 31, 2017 at 9:22 AM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> Moving this one over to -hackers to discuss the fix, as this is clearly an
> issue.
>
> Right now, pg_basebackup will use the pid of the *client* process to
> generate it's ephemeral slot name. Per this report that seems like it can
> definitely be a problem.
>
> One of my first thoughts would be to instead use the pid of the *server* to
> do that, as this will be guaranteed to be unique. However, the client can't
> access the pid of the server as it is now, and its the client that has to
> create the name.

Yes, something like that sounds like a sensible idea. The system
identifier won't help either.

> One way to do that would be to include the pid of the walsender backend in
> the reply to IDENTIFY_SYSTEM, and then use that. What do people think of
> that idea?
>
> Other suggestions?

Here is a funky idea: add a read-only GUC parameter that reports the
PID of the process, and use the SHOW command with the replication
protocol to get the PID on backend-side.
--
Michael

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andres Freund 2017-05-31 18:18:01 Re: Re: [GENERAL] pg_basebackup error: replication slot "pg_basebackup_2194" already exists
Previous Message Julien Rouhaud 2017-05-31 16:32:30 Re: Ora2Pg-Database migration report

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-05-31 18:18:01 Re: Re: [GENERAL] pg_basebackup error: replication slot "pg_basebackup_2194" already exists
Previous Message Chapman Flack 2017-05-31 17:51:20 Re: [PATCH] quiet conversion warning in DatumGetFloat4