Re: Streaming replication and WAL archive interactions - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Streaming replication and WAL archive interactions
Date
Msg-id 20150131130717.GN24213@alap3.anarazel.de
Whole thread Raw
In response to Re: Streaming replication and WAL archive interactions  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: [HACKERS] Streaming replication and WAL archive interactions
List pgsql-hackers
Hi,

On 2014-12-19 22:56:40 +0200, Heikki Linnakangas wrote:
> This add two new archive_modes, 'shared' and 'always', to indicate whether
> the WAL archive is shared between the primary and standby, or not. In
> shared mode, the standby tracks which files have been archived by the
> primary. The standby refrains from recycling files that the primary has
> not yet archived, and at failover, the standby archives all those files too
> from the old timeline. In 'always' mode, the standby's WAL archive is
> taken to be separate from the primary's, and the standby independently
> archives all files it receives from the primary.

I don't really like this approach. Sharing a archive is rather dangerous
in my experience - if your old master comes up again (and writes in the
last wal file) or similar, you can get into really bad situations.

What I was thinking about was instead trying to detect the point up to
which files were safely archived by running restore command to check for
the presence of archived files. Then archive anything that has valid
content and isn't yet archived. That doesn't sound particularly
complicated to me.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Safe memory allocation functions
Next
From: Amit Kapila
Date:
Subject: Re: TABLESAMPLE patch