pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Karsten Hilbert <Karsten.Hilbert@gmx.net>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Aw: Re: pg_dump include/exclude data, was: verify checksums / CREATE DATABASE
Date: Tue, 11 Jun 2019 16:54:38 -0700
Message-ID: <91e6acfa-3b6f-ed53-26b6-c3d6aa72c440@aklaver.com> (raw)
In-Reply-To: <trinity-09990bfd-ae66-4c01-b9bb-cafb31a57e9f-1560276934383@3c-app-gmx-bs19>
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>
	<084004cf-cb61-bee1-98ad-6a9e3e8e74b8@aklaver.com>
	<trinity-09990bfd-ae66-4c01-b9bb-cafb31a57e9f-1560276934383@3c-app-gmx-bs19>

On 6/11/19 11:15 AM, Karsten Hilbert wrote:
>>> 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.
> 
> Ah, no, I did not explain myself well.
> 
> Let's assume a corrupted, bad (but readable at the hardware
> level) disk block B. A filesystem level copy (as in CREATE
> DATABASE) would successfully read that disk block B and
> copy the corrupted content into a good disk block G elsewhere
> on the disk. Verifying the checksum of the page sitting on
> block B before doing the database cloning would
> reveal the corruption before it got cloned.
> 
> Does that make sense ?

Yes.

> 
> Karsten
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (2+ messages)

Message-ID: <91e6acfa-3b6f-ed53-26b6-c3d6aa72c440@aklaver.com>
Permalink:  ../91e6acfa-3b6f-ed53-26b6-c3d6aa72c440@aklaver.com/
Also on:    postgresql.org/message-id/91e6acfa-3b6f-ed53-26b6-c3d6aa72c440@aklaver.com

 · 

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: adrian.klaver@aklaver.com, Karsten.Hilbert@gmx.net
  Subject: Re: pg_dump include/exclude data, was: verify checksums / CREATE DATABASE
  In-Reply-To: <91e6acfa-3b6f-ed53-26b6-c3d6aa72c440@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> <20190611071546.GB2660@hermes.hilbert.loc> <084004cf-cb61-bee1-98ad-6a9e3e8e74b8@aklaver.com> <trinity-09990bfd-ae66-4c01-b9bb-cafb31a57e9f-1560276934383@3c-app-gmx-bs19> <91e6acfa-3b6f-ed53-26b6-c3d6aa72c440@aklaver.com>

* 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