Re: Shared WAL archive between master and standby: WALs not always identical

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Sasa Vilic <sasavilic(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Shared WAL archive between master and standby: WALs not always identical
Date: 2017-02-28 01:46:11
Message-ID: CAKFQuwaPScLY4vCKa3pZX=Y=Ria4nM9P2auBd65SuNURwzjmkw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Feb 27, 2017 at 6:33 PM, Sasa Vilic <sasavilic(at)gmail(dot)com> wrote:

> Hi David,
>
> thanks for the answer. I read this in documentation but here there is a
> corner case that I am not sure how to handle:
> """
> This requires more care in the archive_command, as it must be careful to
> not overwrite an existing file with different contents, *but return
> success if the exactly same file is archived twice.*
> """
> But what I am supposed to do when content differs? Still return success
> and ignore or return error? If I return error, wouldn't that prevent wal
> archiver slave from pushing further WALs?
>
>
​As Adrian said - I'm not seeing the point to even dealing with a shared
archive. My solution would be to avoid the problem completely by pointing
the standby WAL elsewhere.

That said, if I was a guessing man, I would say that, yes, you indicate
failure. The file in question will exist within the archive and will
contain the contents from the master. The standby's view of the file would
be discarded.​

"as it must be careful to not overwrite an existing file with different
contents, but return success if the exactly same file is archived twice." -
the unspoken flip side is not returning true if the "not overwrite"
provision took precedence.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2017-02-28 01:48:17 Re: Shared WAL archive between master and standby: WALs not always identical
Previous Message Sasa Vilic 2017-02-28 01:45:43 Re: Shared WAL archive between master and standby: WALs not always identical