pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
To: Rui DeSousa <rui.desousa@icloud.com>
To: scott ribe <scott_ribe@elevated-dev.com>
Cc: Dianne Skoll <dfs@roaringpenguin.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Reliable WAL file shipping over unreliable network
Date: Fri, 2 Mar 2018 11:40:51 +1300
Message-ID: <f121e8a2-2321-7478-4759-a02377410994@catalyst.net.nz> (raw)
In-Reply-To: <E6AB850C-D05E-405B-8D4E-DE18E128F402@icloud.com>
References: <dd116172-3ddf-ee56-57f3-6e18d49abf8e@shopzeus.com>
	<400AC9CD-1E43-422C-A689-70BDBAFF231E@elevated-dev.com>
	<ee3ae4be-ab24-8443-82c1-95bcd4f86a63@shopzeus.com>
	<debd4205-e27a-cd9d-9169-6748e65083a2@shopzeus.com>
	<BA4A1866-95B0-49C6-8CD1-3D1B60A7837E@elevated-dev.com>
	<CF30D15A-BD42-42A7-9AD3-BB69AF9E8047@icloud.com>
	<D5B11CF5-E816-435B-BFB8-1226E23C046A@elevated-dev.com>
	<37C5A42B-4CDD-4F01-8F1E-1B185C1819B9@icloud.com>
	<20180228132620.2c882f84@hydrogen.roaringpenguin.com>
	<33220469-5BB2-4A40-8F56-8F4F392C95B3@icloud.com>
	<21AF0CB4-0873-4960-BA14-E72FA08B352E@icloud.com>
	<5a49c387-e4f4-f70c-537c-9c338c80b687@catalyst.net.nz>
	<9DDA6F85-077E-4F8D-8708-632CC2907D3C@icloud.com>
	<06dd8b81-8b1a-ae5c-8ddd-1556b5946176@catalyst.net.nz>
	<6056907B-551F-4ED0-804B-0FCACD39EB23@icloud.com>
	<ea674584-85bc-3f63-c182-0d45123bb3eb@catalyst.net.nz>
	<988AB20C-9FDE-4197-BF3F-C54D80C2ED78@elevated-dev.com>
	<E6AB850C-D05E-405B-8D4E-DE18E128F402@icloud.com>

On 02/03/18 03:21, Rui DeSousa wrote:

>
>
>> On Mar 1, 2018, at 12:21 AM, scott ribe <scott_ribe@elevated-dev.com 
>> <mailto:scott_ribe@elevated-dev.com>> wrote:
>>
>> The false report of success is not good, but it's not the root problem.
>
> A false success if a problem; especially in this use case as the 
> source WAL file will be deleted by Postgres before it was truly 
> successful.  While monitoring is nice to avoid the issue it is not a 
> fix for the issue.
>
> I personally cannot recommend the use of rsync in this application for 
> two reasons.
>
> 1. It adds no value; it’s a more complex cp command (no bandwidth 
> saved, etc as archive processes a single file at a time).
> 2. It lies on success/failure — Period.
>
>
> I have use “cat” longer than I have used rsync to archive WALs.  I can 
> say that I’ve lost zero WAL files using cat; I can not say the same 
> for rsync.
>
> The following code is more reliable than rsync and works with across 
> multiple platforms and filesystems without fail.
>
> STS=3
>
> OUTPUT=$(cat $XLOGFILE | $SSH_CMD "(mkdir -p $ARCH_DIR && cat > 
> $ARCH_DIR/$WALFILE.swap) && mv $ARCH_DIR/$WALFILE.swap 
> $ARCH_DIR/$WALFILE")
> if [ $? == 0 ]; then
>    STS=0
> fi
>
> exit $STS
>
>

If you have a self contained case that demonstrates rsync returning 0 
when it has actually failed, then please do get the rsync authors 
involved in investigating it (I'm sure they would be interested).

Now I've been unable to reproduce any cases of bad return codes or zero 
length files (using rsync based archive command + quotas), however I'm 
probably not using the same setup as you (and probably a different 
platform as well).

regards
Mark




view thread (59+ messages)  latest in thread

Message-ID: <f121e8a2-2321-7478-4759-a02377410994@catalyst.net.nz>
Permalink:  ../f121e8a2-2321-7478-4759-a02377410994@catalyst.net.nz/
Also on:    postgresql.org/message-id/f121e8a2-2321-7478-4759-a02377410994@catalyst.net.nz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mark.kirkwood@catalyst.net.nz, rui.desousa@icloud.com, scott_ribe@elevated-dev.com, dfs@roaringpenguin.com
  Subject: Re: Reliable WAL file shipping over unreliable network
  In-Reply-To: <f121e8a2-2321-7478-4759-a02377410994@catalyst.net.nz>
  References: <dd116172-3ddf-ee56-57f3-6e18d49abf8e@shopzeus.com> <ee3ae4be-ab24-8443-82c1-95bcd4f86a63@shopzeus.com> <debd4205-e27a-cd9d-9169-6748e65083a2@shopzeus.com> <BA4A1866-95B0-49C6-8CD1-3D1B60A7837E@elevated-dev.com> <CF30D15A-BD42-42A7-9AD3-BB69AF9E8047@icloud.com> <D5B11CF5-E816-435B-BFB8-1226E23C046A@elevated-dev.com> <37C5A42B-4CDD-4F01-8F1E-1B185C1819B9@icloud.com> <20180228132620.2c882f84@hydrogen.roaringpenguin.com> <33220469-5BB2-4A40-8F56-8F4F392C95B3@icloud.com> <21AF0CB4-0873-4960-BA14-E72FA08B352E@icloud.com> <5a49c387-e4f4-f70c-537c-9c338c80b687@catalyst.net.nz> <9DDA6F85-077E-4F8D-8708-632CC2907D3C@icloud.com> <06dd8b81-8b1a-ae5c-8ddd-1556b5946176@catalyst.net.nz> <6056907B-551F-4ED0-804B-0FCACD39EB23@icloud.com> <ea674584-85bc-3f63-c182-0d45123bb3eb@catalyst.net.nz> <988AB20C-9FDE-4197-BF3F-C54D80C2ED78@elevated-dev.com> <E6AB850C-D05E-405B-8D4E-DE18E128F402@icloud.com> <f121e8a2-2321-7478-4759-a02377410994@catalyst.net.nz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox