pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karsten Hilbert <Karsten.Hilbert@gmx.net>
To: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: pg_dump include/exclude data, was: verify checksums / CREATE DATABASE
Date: Tue, 11 Jun 2019 09:15:46 +0200
Message-ID: <20190611071546.GB2660@hermes.hilbert.loc> (raw)
In-Reply-To: <65d1d891-5063-2094-9e3b-7b0e2926f82c@aklaver.com>
References: <20190605144737.GC16572@hermes.hilbert.loc>
	<CABUevEw8c+5nW0mgFBjhbvefzyxFnFL77BrjTZMRQqRQ1pWBHg@mail.gmail.com>
	<20190606135037.GJ1767@hermes.hilbert.loc>
	<65d1d891-5063-2094-9e3b-7b0e2926f82c@aklaver.com>

Dear Adrian,

On Fri, Jun 07, 2019 at 08:02:32AM -0700, Adrian Klaver wrote:

> On 6/6/19 6:50 AM, Karsten Hilbert wrote:
> > The current canonical solution (?) for verifying checksums in
> > an existing database is, to may understanding, to pg_dump it
> > (to /dev/null, perhaps):
> >
> > 	pg_dump --username=... --dbname=... --compress=0 --no-sync --format=custom --file=/dev/null
> >
> > as that will read and verify all blocks related to the dump
> > of that database.
>
> The above works with the existing cluster, but would you not also want to
> verify that the blocks written to on the new cluster also are good?

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.

> > 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





view thread (6+ messages)  latest in thread

Message-ID: <20190611071546.GB2660@hermes.hilbert.loc>
Permalink:  ../20190611071546.GB2660@hermes.hilbert.loc/
Also on:    postgresql.org/message-id/20190611071546.GB2660@hermes.hilbert.loc

 · 

reply

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: Karsten.Hilbert@gmx.net, adrian.klaver@aklaver.com
  Subject: Re: pg_dump include/exclude data, was: verify checksums / CREATE DATABASE
  In-Reply-To: <20190611071546.GB2660@hermes.hilbert.loc>
  References: <20190605144737.GC16572@hermes.hilbert.loc> <CABUevEw8c+5nW0mgFBjhbvefzyxFnFL77BrjTZMRQqRQ1pWBHg@mail.gmail.com> <20190606135037.GJ1767@hermes.hilbert.loc> <65d1d891-5063-2094-9e3b-7b0e2926f82c@aklaver.com> <20190611071546.GB2660@hermes.hilbert.loc>

* 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