Re: Block-level CRC checks

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Block-level CRC checks
Дата
Msg-id 20081030183426.GB21451@svana.org
обсуждение исходный текст
Ответ на Re: Block-level CRC checks  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-hackers
On Thu, Oct 30, 2008 at 03:41:17PM +0000, Gregory Stark wrote:
> The CRC is chosen such that if you CRC the resulting packet including the CRC
> you get a CRC of 0. That can be done for whatever offset the CRC appears at I
> believe.

IIRC, you calculate the CRC-32 of the page, then XOR it over where it's
supposed to end up. No need to preseed (or more accurately, it doesn't
matter how you preseed, the result is the same).

For checking it doesn't matter either, just checksum the page and if
you get zero it's correct.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Block-level CRC checks
Следующее
От: Martin Pihlak
Дата:
Сообщение: Re: contrib/pg_stat_statements