Re: Including replication slot data in base backups

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Including replication slot data in base backups
Date: 2014-04-01 14:45:46
Message-ID: CABUevEyta_M=TUw2NM7Y5hgNjQ6fNvPRUFCQhyGcBFYyghD9+w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 1, 2014 at 2:24 PM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com>wrote:

> Hi all,
>
> As of now, pg_basebackup creates an empty repository for pg_replslot/
> in a base backup, forcing the user to recreate slots on other nodes of
> the cluster with pg_create_*_replication_slot, or copy pg_replslot
> from another node. This is not really user-friendly especially after a
> failover where a given slave may not have the replication slot
> information of the master that it is replacing.
>
> The simple patch attached adds a new option in pg_basebackup, called
> --replication-slot, allowing to include replication slot information
> in a base backup. This is done by extending the command BASE_BACKUP in
> the replication protocol.
>

--replication-slots would be a better name (plural), or probably
--include-replication-slots. (and that comment also goes for the
BASE_BACKUP syntax and variables)

But. If you want to solve the failover case, doesn't that mean you need to
include it in the *replication* stream and not just the base backup?
Otherwise, what you're sending over might well be out of date set of slots
once the failover happens? What if the set of replication slots change
between the time of the basebackup and the failover?

As it is too late for 9.4, I would like to add it to the first commit
> fest of 9.5. Comments are welcome.
>

It's not too late to fix omissions in 9.4 features though, if we consider
it that. Which I think this could probably be considered as - if we think
the solution is the right one.

--
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 Andrew Dunstan 2014-04-01 14:57:25 Re: pg_stat_statements cluttered with "DEALLOCATE dbdpg_p*"
Previous Message Fabien COELHO 2014-04-01 14:45:29 pg_stat_statements cluttered with "DEALLOCATE dbdpg_p*"