Re: pgsql: Validate page level checksums in base backups - Mailing list pgsql-hackers

From David Steele
Subject Re: pgsql: Validate page level checksums in base backups
Date
Msg-id 115dac54-38b8-b7f8-5953-3a4a57706790@pgmasters.net
Whole thread Raw
In response to Re: pgsql: Validate page level checksums in base backups  (Michael Banck <michael.banck@credativ.de>)
List pgsql-hackers
On 4/3/18 4:48 PM, Michael Banck wrote:
> 
> Attached is a patch which does that hopefully:
> 
> 1. creates two user tables, one large enough for at least 6 blocks
> (around 360kb), the other just one block.
> 
> 2. stops the cluster before scribbling over its data and starts it
> afterwards.
> 
> 3. uses the blocksize (and the pager header size) to determine offsets
> for scribbling.

This patch looks reasonable to me.

> I've tested it with blocksizes 8 and 32 now, the latter should make sure
> that the first table is indeed large enough, but maybe something less
> arbitrary than "10000 integers" should be used?

It might be quicker to just stop the cluster and then write out an 
arbitrary number of zero pages.  Zero pages are always considered valid 
so you can then corrupt whichever pages you want for testing.

-- 
-David
david@pgmasters.net


pgsql-hackers by date:

Previous
From: Michael Banck
Date:
Subject: Re: pgsql: Validate page level checksums in base backups
Next
From: Robert Haas
Date:
Subject: Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS