Re: pg_dump, pg_dumpall and data durability

Albe Laurenz <laurenz.albe@wien.gv.at>

From: Albe Laurenz <laurenz.albe@wien.gv.at>
To: "'Michael Paquier *EXTERN*'" <michael.paquier@gmail.com>, "PostgreSQL mailing lists" <pgsql-hackers@postgresql.org>
Date: 2016-11-07T16:24:28Z
Lists: pgsql-hackers
Michael Paquier wrote:
>> In my quest of making the backup tools more compliant to data
>> durability, here is a thread for pg_dump and pg_dumpall.
> 
> Okay, here is a patch doing the above. I have added a new --nosync
> option to pg_dump and pg_dumpall to switch to the pre-10 behavior. I
> have arrived at the conclusion that it is better not to touch at
> _EndData and _EndBlob, and just issue the fsync in CloseArchive when
> all the write operations are done. In the case of the directory
> format, the fsync is done on all the entries recursively. This makes
> as well the patch more simple. The regression tests calling pg_dump
> don't use --nosync yet in this patch, that's a move that could be done
> afterwards.

The patch does not apply, I had to change the hunk for
src/include/common/file_utils.h.

Also, compilation fails because function "pre_fsync_fname" cannot be
resolved during linking. Is that a typo for "pre_fsync_fname" or is
the patch incomplete?

Yours,
Laurenz Albe

Commits

  1. Sync pg_dump and pg_dumpall output