Re: pg_dump include/exclude data, was: verify checksums / CREATE DATABASE

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_dump include/exclude data, was: verify checksums / CREATE DATABASE
Date: 2019-06-11 14:16:13
Message-ID: 084004cf-cb61-bee1-98ad-6a9e3e8e74b8@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 6/11/19 12:15 AM, Karsten Hilbert wrote:
> Dear Adrian,

> Sure, but that much depends on what (or rather, where) the
> "new cluster" actually is.
>
> In my case I want to make sure that - before a run of "CREATE
> DATABASE new TEMPLATE old" - I can be reasonable sure that
> the disk blocks underlying "old" verify against their
> checksum. Since the CREATE DATABASE does not verify CRCs I
> use a pg_dump into /dev/null to verify checksums while the
> cluster is *online*.
>
> The problem I hope to protect against with this approach: the
> CREATE DATABASE might untaint corrupted data from a bad disk
> block into a good disk block virtue of doing a file level
> copy.
>
> I hope my reasoning isn't going astray.

As I understand it checksums are done on the page level using a hash(for
details: https://doxygen.postgresql.org/checksum__impl_8h_source.html)
I am not sure how a page could get un-corrupted by virtue of a file copy.

>
>>> One will be tempted to include options to speed up the
>>> process, say:
> ...
>>> Is my assumption wrong ?
>>
>> Not sure, though it would seem to me including the above is a relatively
>> small incremental cost to the overall dump, assuming a data set of any size
>> greater then small.
>
> Agreed. Good putting of things into perspective. Will do.
>
> Thanks,
> Karsten
> --
> GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Igal Sapir 2019-06-11 17:45:27 Featured Big Name Users of Postgres
Previous Message Karsten Hilbert 2019-06-11 07:27:14 Re: pg_dump include/exclude data, was: verify checksums / CREATE DATABASE