Обсуждение: pgsql: Add TAP tests for pg_verify_checksums

Поиск
Список
Период
Сортировка

pgsql: Add TAP tests for pg_verify_checksums

От
Michael Paquier
Дата:
Add TAP tests for pg_verify_checksums

All options available in the utility get coverage:
- Tests with disabled page checksums.
- Tests with enabled test checksums.
- Emulation of corruption and broken checksums with a full scan and
single relfilenode scan.

This patch has been contributed mainly by Michael Banck and Magnus
Hagander with things presented on various threads, and I have gathered
all the contents into a single patch.

Author: Michael Banck, Magnus Hagander, Michael Paquier
Reviewed-by: Peter Eisentraut
Discussion: https://postgr.es/m/20181005012645.GE1629@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b34e84f160a47d9070b304bfc1baf17596d71865

Modified Files
--------------
src/bin/initdb/t/001_initdb.pl               | 14 +++++-
src/bin/pg_verify_checksums/.gitignore       |  2 +
src/bin/pg_verify_checksums/Makefile         |  6 +++
src/bin/pg_verify_checksums/t/001_basic.pl   |  8 ++++
src/bin/pg_verify_checksums/t/002_actions.pl | 69 ++++++++++++++++++++++++++++
5 files changed, 98 insertions(+), 1 deletion(-)


Re: pgsql: Add TAP tests for pg_verify_checksums

От
Andrew Dunstan
Дата:

On 10/11/2018 08:17 PM, Michael Paquier wrote:
> Add TAP tests for pg_verify_checksums
>
> All options available in the utility get coverage:
> - Tests with disabled page checksums.
> - Tests with enabled test checksums.
> - Emulation of corruption and broken checksums with a full scan and
> single relfilenode scan.
>
> This patch has been contributed mainly by Michael Banck and Magnus
> Hagander with things presented on various threads, and I have gathered
> all the contents into a single patch.
>
> Author: Michael Banck, Magnus Hagander, Michael Paquier
> Reviewed-by: Peter Eisentraut
> Discussion: https://postgr.es/m/20181005012645.GE1629@paquier.xyz


We have some failures here on Windows. I suspect we might need to do a 
little more surgery like was done in commit 
efd7f8e36553cd32e445061cbbc80d32028f4248

cheers

andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Re: pgsql: Add TAP tests for pg_verify_checksums

От
Andrew Dunstan
Дата:

On 10/12/2018 05:14 PM, Andrew Dunstan wrote:
>
>
> On 10/11/2018 08:17 PM, Michael Paquier wrote:
>> Add TAP tests for pg_verify_checksums
>>
>> All options available in the utility get coverage:
>> - Tests with disabled page checksums.
>> - Tests with enabled test checksums.
>> - Emulation of corruption and broken checksums with a full scan and
>> single relfilenode scan.
>>
>> This patch has been contributed mainly by Michael Banck and Magnus
>> Hagander with things presented on various threads, and I have gathered
>> all the contents into a single patch.
>>
>> Author: Michael Banck, Magnus Hagander, Michael Paquier
>> Reviewed-by: Peter Eisentraut
>> Discussion: https://postgr.es/m/20181005012645.GE1629@paquier.xyz
>
>
> We have some failures here on Windows. I suspect we might need to do a 
> little more surgery like was done in commit 
> efd7f8e36553cd32e445061cbbc80d32028f4248
>
>

No, hah, I see what it's doing. It's trying to checksum a non-data file 
that only exists in the EXEC_BACKEND case:

pg_verify_checksums: could not read block 0 in file
"G:/prog/bf/root/HEAD/pgsql.build/src/bin/pg_verify_checksums/tmp_check/t_002_actions_node_checksum_data/pgdata/global/config_exec_params":
read4843 of 8192
 

This gadget needs to learn to exclude such files.

cheers

andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Re: pgsql: Add TAP tests for pg_verify_checksums

От
Andres Freund
Дата:
On 2018-10-12 17:46:17 -0400, Andrew Dunstan wrote:
> 
> 
> On 10/12/2018 05:14 PM, Andrew Dunstan wrote:
> > 
> > 
> > On 10/11/2018 08:17 PM, Michael Paquier wrote:
> > > Add TAP tests for pg_verify_checksums
> > > 
> > > All options available in the utility get coverage:
> > > - Tests with disabled page checksums.
> > > - Tests with enabled test checksums.
> > > - Emulation of corruption and broken checksums with a full scan and
> > > single relfilenode scan.
> > > 
> > > This patch has been contributed mainly by Michael Banck and Magnus
> > > Hagander with things presented on various threads, and I have gathered
> > > all the contents into a single patch.
> > > 
> > > Author: Michael Banck, Magnus Hagander, Michael Paquier
> > > Reviewed-by: Peter Eisentraut
> > > Discussion: https://postgr.es/m/20181005012645.GE1629@paquier.xyz
> > 
> > 
> > We have some failures here on Windows. I suspect we might need to do a
> > little more surgery like was done in commit
> > efd7f8e36553cd32e445061cbbc80d32028f4248
> > 
> > 
> 
> No, hah, I see what it's doing. It's trying to checksum a non-data file that
> only exists in the EXEC_BACKEND case:
> 
> pg_verify_checksums: could not read block 0 in file
"G:/prog/bf/root/HEAD/pgsql.build/src/bin/pg_verify_checksums/tmp_check/t_002_actions_node_checksum_data/pgdata/global/config_exec_params":
read4843 of 8192
 
> 
> This gadget needs to learn to exclude such files.

See conversation around http://archives.postgresql.org/message-id/20181012060543.GE30064%40paquier.xyz


Re: pgsql: Add TAP tests for pg_verify_checksums

От
Andrew Dunstan
Дата:

On 10/12/2018 05:52 PM, Andres Freund wrote:
> On 2018-10-12 17:46:17 -0400, Andrew Dunstan wrote:
>>
>> On 10/12/2018 05:14 PM, Andrew Dunstan wrote:
>>>
>>> On 10/11/2018 08:17 PM, Michael Paquier wrote:
>>>> Add TAP tests for pg_verify_checksums
>>>>
>>>> All options available in the utility get coverage:
>>>> - Tests with disabled page checksums.
>>>> - Tests with enabled test checksums.
>>>> - Emulation of corruption and broken checksums with a full scan and
>>>> single relfilenode scan.
>>>>
>>>> This patch has been contributed mainly by Michael Banck and Magnus
>>>> Hagander with things presented on various threads, and I have gathered
>>>> all the contents into a single patch.
>>>>
>>>> Author: Michael Banck, Magnus Hagander, Michael Paquier
>>>> Reviewed-by: Peter Eisentraut
>>>> Discussion: https://postgr.es/m/20181005012645.GE1629@paquier.xyz
>>>
>>> We have some failures here on Windows. I suspect we might need to do a
>>> little more surgery like was done in commit
>>> efd7f8e36553cd32e445061cbbc80d32028f4248
>>>
>>>
>> No, hah, I see what it's doing. It's trying to checksum a non-data file that
>> only exists in the EXEC_BACKEND case:
>>
>> pg_verify_checksums: could not read block 0 in file
"G:/prog/bf/root/HEAD/pgsql.build/src/bin/pg_verify_checksums/tmp_check/t_002_actions_node_checksum_data/pgdata/global/config_exec_params":
read4843 of 8192
 
>>
>> This gadget needs to learn to exclude such files.
> See conversation around http://archives.postgresql.org/message-id/20181012060543.GE30064%40paquier.xyz

Ah, thanks, missed that.

cheers

andrew

-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services