On Mon, Apr 6, 2020 at 2:23 PM Stephen Frost <sfrost@snowman.net> wrote:
> So, instead of talking about 'bzip2 > %f.bz2', and then writing into our
> documentation that that's how this feature can be used, what about
> proposing something that would actually work reliably with this
> interface? Which properly fsync's everything, has good retry logic for
> when failures happen, is able to actually detect when a failure
> happened, how to restore from a backup taken this way, and it'd probably
> be good to show how pg_verifybackup could be used to make sure the
> backup is actually correct and valid too.
I don't really understand the problem here. Suppose I do:
mkdir ~/my-brand-new-empty-directory
cd ~/my-brand-new-empty-directory
pg_basebackup -Ft --pipe-output 'bzip2 > %f.bz2'
initdb -S --dont-expect-that-this-is-a-data-directory . # because
right now it would complain about pg_wal and pg_tblspc being missing
I think if all that works, my backup should be good and durably on
disk. If it's not, then either pg_basebackup or bzip2 or initdb didn't
report errors that they should have reported. If you're worried about
that, say because you suspect those programs are buggy or because you
think the kernel may not be reporting errors properly, you can use tar
-jxvf + pg_validatebackup to check.
What *exactly* do you think can go wrong here?
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company