Re: pg_basebackup and replication slots - Mailing list pgsql-hackers

From Andres Freund
Subject Re: pg_basebackup and replication slots
Date
Msg-id 20150729125401.GE24218@alap3.anarazel.de
Whole thread Raw
In response to Re: pg_basebackup and replication slots  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
On 2015-07-29 13:45:22 +0100, Simon Riggs wrote:
> So this would be needed when creating a standalone backup that would not be
> persistently connected to the master, yet we want to bring it up as a
> live/writable server in a single command

I'm not understanding what you mean with 'single command'
here. Currently there's no way to do this safely without configuring a
high enough wal_keep_segments.

You can (since yesterday) manually create a slot, run pg_basebackup, and
drop the slot. But that's not safe if your script is interrupted
somehow. Since many base backups are run in a non-interactive fashion
asking for intervention to clean up in that case imo is not an
acceptable answer.

> and we want to make it easy to script in case our script is killed?

Or the connection dies/is killed, or the server is restarted, or ...



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Don'st start streaming after creating a slot in pg_receivexlog
Next
From: Stephen Frost
Date:
Subject: Re: A little RLS oversight?