Re: Reliable WAL file shipping over unreliable network

Поиск
Список
Период
Сортировка
От Dianne Skoll
Тема Re: Reliable WAL file shipping over unreliable network
Дата
Msg-id 20180228142202.427f459a@hydrogen.roaringpenguin.com
обсуждение исходный текст
Ответ на Re: Reliable WAL file shipping over unreliable network  (Rui DeSousa <rui.desousa@icloud.com>)
Список 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 по дате отправления:

Предыдущее
От: Dianne Skoll
Дата:
Сообщение: Re: Reliable WAL file shipping over unreliable network
Следующее
От: Nagy László Zsolt
Дата:
Сообщение: Re: Reliable WAL file shipping over unreliable network