Re: TAP tests for pg_verify_checksums

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Michael Banck <michael(dot)banck(at)credativ(dot)de>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Postgres hackers <pgsql-hackers(at)postgresql(dot)org>, Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: TAP tests for pg_verify_checksums
Date: 2018-10-10 01:50:02
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Oct 09, 2018 at 05:14:50PM +0200, Michael Banck wrote:
> Am Dienstag, den 09.10.2018, 16:54 +0200 schrieb Peter Eisentraut:
>> On 06/10/2018 13:46, Michael Paquier wrote:
>>> +# Time to create a corruption
> That looks a bit weird, maybe "some corruption"? Or maybe it's just me
> not being a native speaker.

Okay, let's do with your suggestion.

>> I would also like to see a test that runs against a cluster without
>> checksums enabled.

OK. I have added a test within initdb to save one initdb run.

>> +# Checks cannot happen for an online cluster
>> +$node->start;
>> +command_fails(['pg_verify_checksums', '-D', $pgdata],
>> + "checksum checks not done");
>> The test name should be something like "fails with online cluster".

Done. I have put more thoughts into those.

> One more thing we could check is the relfilenode after we corrupted it,
> it should also catch the corruption then. Or is that too trivial?

There is one as of v3:
+# Checksum checks on single relfilenode fail
+$node->command_checks_all([ 'pg_verify_checksums', '-D', $pgdata, '-r',
+ $relfilenode_corrupted],
+ 1,
+ [qr/Bad checksums:.*1/],
+ [qr/checksum verification failed/],
+ '');

The resulting patch is attached. Does that look good?

Attachment Content-Type Size
verify-checksums-tap-v4.patch text/x-diff 4.7 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-10-10 02:22:45 Re: out-of-order XID insertion in KnownAssignedXids
Previous Message Tsunakawa, Takayuki 2018-10-10 00:27:27 RE: IDE setup and development features?