Re: Reliable WAL file shipping over unreliable network

From: Dianne Skoll <dfs(at)roaringpenguin(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Reliable WAL file shipping over unreliable network
Date: 2018-02-28 19:22:02
Message-ID: 20180228142202.427f459a@hydrogen.roaringpenguin.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, 28 Feb 2018 14:12:39 -0500
Rui DeSousa <rui(dot)desousa(at)icloud(dot)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.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Nagy László Zsolt 2018-02-28 19:25:45 Re: Reliable WAL file shipping over unreliable network
Previous Message Dianne Skoll 2018-02-28 19:16:43 Re: Reliable WAL file shipping over unreliable network