From: Stephen Frost <sfrost@snowman.net>
To: Edson Carlos Ericksson Richter <richter@simkorp.com.br>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Does PostgreSQL check database integrity at startup?
Date: Wed, 27 Dec 2017 09:49:51 -0500
Message-ID: <20171227144951.GU4628@tamriel.snowman.net> (raw)
In-Reply-To: <4c06d5bd-4286-621a-a54e-9ea761c192c1@simkorp.com.br>
References: <20171226171327.437beyi2dnndslwl@alvherre.pgsql>
<7a6d1d6d-3627-c68c-1ce1-b681a7062930@simkorp.com.br>
<e3d09b89-17ba-8638-084a-25eab2abc7ba@2ndquadrant.com>
<4c06d5bd-4286-621a-a54e-9ea761c192c1@simkorp.com.br>
Greetings,
* Edson Carlos Ericksson Richter (richter@simkorp.com.br) wrote:
> Right now, I do prefer to use pg_basebackup instead - but sometimes
> (when database is just too large), rsync seems more reliable (maybe
> it is the cause of the problem).
I don't generally recommend rsync for various reasons, but if you make
sure to call pg_start/stop_backup(), keep track of all your WAL and
verify everything ends up written to disk then it should work. Don't
use it for incrementals though- there are cases where that can fail.
> Anyway, instead digging into rsync functionality (or bugs - I doubt,
> but who knows?), I do prefer to have a script I can run to check if
> there is obvious failures in standby servers.
As mentioned, zero-byte files can be perfectly valid. PostgreSQL does
have page-level CRCs, if you initialized your database with them (which
I would strongly recommend). There are also backup tools which will
verify those checksums when performing a backup of the system. In
addition to that, you can do parallel backup and restore which can
reduce the downtime for doing restores quite a bit (though this will
depend on what you're bottleneck is, of course). I'd suggest you take a
look at pgBackRest, though I think that other solutions now also have
all of these features (though they all have their own features too).
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: sfrost@snowman.net, richter@simkorp.com.br
Subject: Re: Does PostgreSQL check database integrity at startup?
In-Reply-To: <20171227144951.GU4628@tamriel.snowman.net>
References: <20171226171327.437beyi2dnndslwl@alvherre.pgsql> <7a6d1d6d-3627-c68c-1ce1-b681a7062930@simkorp.com.br> <e3d09b89-17ba-8638-084a-25eab2abc7ba@2ndquadrant.com> <4c06d5bd-4286-621a-a54e-9ea761c192c1@simkorp.com.br> <20171227144951.GU4628@tamriel.snowman.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox