Re: [GENERAL] Shared WAL archive between master and standby: WALs notalways identical - Mailing list pgsql-general

From David G. Johnston
Subject Re: [GENERAL] Shared WAL archive between master and standby: WALs notalways identical
Date
Msg-id CAKFQuwaPScLY4vCKa3pZX=Y=Ria4nM9P2auBd65SuNURwzjmkw@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] Shared WAL archive between master and standby: WALs notalways identical  (Sasa Vilic <sasavilic@gmail.com>)
List pgsql-general
On Mon, Feb 27, 2017 at 6:33 PM, Sasa Vilic <sasavilic@gmail.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.

pgsql-general by date:

Previous
From: Sasa Vilic
Date:
Subject: Re: [GENERAL] Shared WAL archive between master and standby: WALs notalways identical
Next
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] Shared WAL archive between master and standby: WALs notalways identical