Re: pgsql: Validate page level checksums in base backups

From: David Steele <david(at)pgmasters(dot)net>
To: Michael Banck <michael(dot)banck(at)credativ(dot)de>, Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Validate page level checksums in base backups
Date: 2018-04-03 21:17:18
Message-ID: 115dac54-38b8-b7f8-5953-3a4a57706790@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers 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(at)pgmasters(dot)net

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-04-03 21:37:04 Re: pgsql: Transforms for jsonb to PL/Perl
Previous Message Andres Freund 2018-04-03 21:13:09 Re: pgsql: Add Bloom filter implementation.

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2018-04-03 21:47:01 Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS
Previous Message Michael Banck 2018-04-03 20:48:15 Re: pgsql: Validate page level checksums in base backups