Re: Backup strategy using 'wal_keep_segments'

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Rhhh Lin <ruanlinehan(at)hotmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Backup strategy using 'wal_keep_segments'
Date: 2017-10-22 22:17:01
Message-ID: CAB7nPqQxufdSgHmP8BB+Stbqg9m-1cA4YpS1TTeT0PRFQjnA3Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Oct 23, 2017 at 5:57 AM, Rhhh Lin <ruanlinehan(at)hotmail(dot)com> wrote:
> Is this approach feasible? Assuming obviously, we have sufficient disk space
> to facilitate 1000 WAL files etc.

You expose yourself to race conditions with such methods if a
checkpoint has the bad idea to recycle past segments that your logic
is copying. So I would advise to not do that. Instead of using the
archive command, you should also consider using pg_receivexlog
combined with a replication slot. This brings way more control with
the error handling.
--
Michael

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2017-10-22 22:19:22 Re: Postgres 9.6 fails to start on VMWare
Previous Message Rhhh Lin 2017-10-22 20:57:46 Backup strategy using 'wal_keep_segments'