Re: Streaming replication and WAL archive interactions

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Borodin Vladimir <root(at)simply(dot)name>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Streaming replication and WAL archive interactions
Date: 2015-01-31 13:07:17
Message-ID: 20150131130717.GN24213@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2015-01-31 13:27:23 Re: TABLESAMPLE patch
Previous Message Michael Paquier 2015-01-31 11:36:37 Re: Safe memory allocation functions