Re: Streaming replication and WAL archive interactions

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To:
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Venkata Balaji N <nag1010(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, 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-05-13 17:23:59
Message-ID: 555388AF.1080103@iki.fi
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

On 05/13/2015 04:29 PM, Robert Haas wrote:
> On Wed, May 13, 2015 at 8:53 AM, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
>> Our manual says that archive_command should refuse to overwrite an existing
>> file. But to work-around the double-archival problem, where the same file is
>> archived twice, it would be even better if it would simply return success if
>> the file exists, *and has identical contents*. I don't know how to code that
>> logic in a simple one-liner though.
>
> This is why we really, really need that pg_copy command that was
> proposed a while back.

Yeah..

I took a step back and looked at the big picture again:

If we just implement the "always" mode, and you have a pg_copy command
or similar that handles duplicates correctly, you don't necessarily need
the "shared" mode at all. You can just set archive_command='always', and
have the master and standby archive to the same location. As long as the
archive_command works correctly and is race-free, that should work.

I cut back the patch to implement just the "always" mode. The "shared"
mode might still make sense as a future patch, as I think it's easier to
understand and has less strict requirements for the archive_command, but
let's take one step at a time.

So attached is a patch that just adds the "always" mode. This is pretty
close to what Fujii submitted long ago.

- Heikki

Attachment Content-Type Size
0001-Add-archive_mode-always-option.patch application/x-patch 13.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sawada Masahiko 2015-05-13 17:49:51 Re: Proposal : REINDEX xxx VERBOSE
Previous Message Robert Haas 2015-05-13 17:17:21 Re: Triaging the remaining open commitfest items