Re: regression test failed when enabling checksum - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: regression test failed when enabling checksum
Date
Msg-id 1364340203.21411.143.camel@sussancws0025
Whole thread Raw
In response to regression test failed when enabling checksum  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: regression test failed when enabling checksum
Re: regression test failed when enabling checksum
List pgsql-hackers
On Tue, 2013-03-26 at 02:50 +0900, Fujii Masao wrote:
> Hi,
>
> I found that the regression test failed when I created the database
> cluster with the checksum and set wal_level to archive. I think that
> there are some bugs around checksum feature. Attached is the regression.diff.

Thank you for the report. This was a significant oversight, but simple
to diagnose and fix.

There were several places that were doing something like:

   PageSetChecksumInplace
   if (use_wal)
      log_newpage
   smgrextend

Which is obviously wrong, because log_newpage set the LSN of the page,
invalidating the checksum. We need to set the checksum after
log_newpage.

Also, I noticed that copy_relation_data was doing smgrread without
validating the checksum (or page header, for that matter), so I also
fixed that.

Patch attached. Only brief testing done, so I might have missed
something. I will look more closely later.

Regards,
    Jeff Davis

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Ignore invalid indexes in pg_dump
Next
From: Michael Paquier
Date:
Subject: Re: Support for REINDEX CONCURRENTLY