Re: Enabling Checksums

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: Enabling Checksums
Дата
Msg-id CA+U5nM+kty+8_1MX6Y0FjM=6-MLcj9McSz69O5znFaEzXzytxQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Enabling Checksums  (Ants Aasma <ants@cybertec.at>)
Ответы Re: Enabling Checksums  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
On 10 April 2013 11:15, Ants Aasma <ants@cybertec.at> wrote:
> * We might even be able to calculate CRC32 checksum for normal WAL records,
> and use Ants' checksum for full page writes (only). So checking WAL checksum
> would then be to confirm header passes CRC32 and then re-check the Ants
> checksum of each backup block.

If we ensure that the checksum on the page is correct when we do a
full page write then we could only include the checksum field in the
WAL CRC. When reading WAL we would first check that the CRC is correct
and then verify the the page checksum.

OK, so we have a single combined "calculate a checksum for a block" function. That uses Jeff's zeroing trick and Ants' bulk-oriented performance optimization.

For buffer checksums we simply calculate for the block.

For WAL full page writes, we first set the checksums for all defined buffers, then calculate the checksum of remaining data plus the pd_checksum field from each block using the normal WAL CRC32.

Seems good to me. One set of fast code. And it avoids the weirdness that the checksum stored on the full page is actually wrong.

It also means that the WAL checksum calculation includes the hole, yet we do not include the data for the hole. So we have to do an extra copy when restoring the backuo block.

Comments?

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: SIGHUP not received by custom bgworkers if postmaster is notified
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [GSOC] questions about idea "rewrite pg_dump as library"