Re: TAP tests for pg_verify_checksums

From: Michael Banck <michael(dot)banck(at)credativ(dot)de>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: 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-05 11:38:05
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On Fri, Oct 05, 2018 at 10:26:45AM +0900, Michael Paquier wrote:
> The topic of $subject has been discussed a bit times, resulting in a
> couple of patches on the way:
> However nothing has actually happened. Based on the previous feedback,
> attached is an updated patch to do the actual job.


It's too late for v11 though at this point I guess?

I think it would be easy to also test the -r command-line option, as we
already create a table. Something like

|my $relfilenode_corrupted = $node->safe_psql('postgres',
| "SELECT relfilenode FROM pg_class WHERE relname = 'corrupt1'");


|# Checksums pass solely on that table
|command_ok(['pg_verify_checksums', '-D', $pgdata, '-r', $relfilenode_corrupted],
| "checksum checks for table relfilenode done and passing");

While making sure the $node->stop is between the two.

One nitpick:

> diff --git a/src/bin/pg_verify_checksums/t/ b/src/bin/pg_verify_checksums/t/
> new file mode 100644
> index 0000000000..7423595181
> --- /dev/null
> +++ b/src/bin/pg_verify_checksums/t/
> +# Control file should know that checksums are disabled.
> +command_like(['pg_controldata', $pgdata],
> + qr/Data page checksum version:.*1/,
> + 'checksums enabled in control file');

That comment should read 'that checksums are enabled', right?

Otherwise, LGTM and I've tested it without finding any problems.


Michael Banck
Projektleiter / Senior Berater
Tel.: +49 2166 9901-171
Fax: +49 2166 9901-100
Email: michael(dot)banck(at)credativ(dot)de

credativ GmbH, HRB Mönchengladbach 12080
USt-ID-Nummer: DE204566209
Trompeterallee 108, 41189 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer

Unser Umgang mit personenbezogenen Daten unterliegt
folgenden Bestimmungen:

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-10-05 12:15:30 Re: Procedure calls are not tracked in pg_stat_user_functions / track_functions
Previous Message Peter Eisentraut 2018-10-05 11:28:54 Re: transction_timestamp() inside of procedures