Re: Does PostgreSQL check database integrity at startup?

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Edson Carlos Ericksson Richter <richter(at)simkorp(dot)com(dot)br>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Does PostgreSQL check database integrity at startup?
Date: 2017-12-27 17:02:13
Message-ID: 20171227170213.GW4628@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro,

* Alvaro Herrera (alvherre(at)2ndquadrant(dot)com) wrote:
> Stephen Frost wrote:
>
> > * Edson Carlos Ericksson Richter (richter(at)simkorp(dot)com(dot)br) wrote:
>
> > > 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).
>
> Page-level checksums would not detect the problem being complained in
> this thread, however.

It's entirely unclear to me what the problem being complained about in
this thread actually is. The complaint so far was about zero-byte
files, but those are entirely valid, so that isn't a problem that anyone
can solve..

Given the thread subject, if someone actually wanted to do a database
integrity check before startup, they could use pgBackRest to perform a
backup with a CRC-enabled database and at least verify that all of the
checksums are valid.

We could possibly look into adding some set of additional checks for
files which can't actually be zero-byte, perhaps.. I know we have some
other one-off checks already.

Thanks!

Stephen

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Edson Carlos Ericksson Richter 2017-12-27 17:30:48 Re: Does PostgreSQL check database integrity at startup?
Previous Message Alvaro Herrera 2017-12-27 16:47:46 Re: Does PostgreSQL check database integrity at startup?