Re: Reliable WAL file shipping over unreliable network - Mailing list pgsql-admin

From Dianne Skoll
Subject Re: Reliable WAL file shipping over unreliable network
Date
Msg-id 20180228142202.427f459a@hydrogen.roaringpenguin.com
Whole thread Raw
In response to Re: Reliable WAL file shipping over unreliable network  (Rui DeSousa <rui.desousa@icloud.com>)
List pgsql-admin
On Wed, 28 Feb 2018 14:12:39 -0500
Rui DeSousa <rui.desousa@icloud.com> wrote:

> You are dealing with a race condition. Postgres will continually
> attempt to archive the same file over and over until rsync foolishly
> returns success.  

What do you mean by "rsync foolishly returns success"?

> You are making the assumption that rsync removed the file?

Rsync does not create the file with the final name until it
has successfully transferred it completely.  It copies it to a temporary
file and then if (and only if) the transfer succeeded, then it atomically
renames the temporary file to the final filename.

The only failure mode if metadata updates are lost is that the file
will appear not to exist when it really should, not the other way
around.  You can never, ever have the file existing with the proper
filename until a transfer has succeeded.

However, see my other post about a test.  The -c option doesn't actually
help if a file changes while rsync is running.

Regards,

Dianne.


pgsql-admin by date:

Previous
From: Dianne Skoll
Date:
Subject: Re: Reliable WAL file shipping over unreliable network
Next
From: Nagy László Zsolt
Date:
Subject: Re: Reliable WAL file shipping over unreliable network