Re: Enabling Checksums

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: Enabling Checksums
Дата
Msg-id CA+U5nMK_Z7-TYugRCvbJZE-kxO9roXR9urv0P1UN2GW8VPYKPw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Enabling Checksums  (Ants Aasma <ants@cybertec.at>)
Ответы Re: Enabling Checksums  (Ants Aasma <ants@cybertec.at>)
Список pgsql-hackers
On 10 April 2013 09:01, Ants Aasma <ants@cybertec.at> wrote:

> Using SIMD for WAL is not a requirement at all; I just thought it might
> be a nice benefit for non-checksum-enabled users in some later release.

I think we should first deal with using it for page checksums and if
future versions want to reuse some of the code for WAL checksums then
we can rearrange the code.

We have essentially the same problem in both cases: we want to calculate a checksum of BLCKSZ chunks of data, plus some smaller header data. We currently use the same code for both cases and it makes sense to do the same thing with any new code. This is also the *same* issue: when we make a new hint we need to issue a full page write in WAL, so we are calculating checksums in two new places: XLOG_HINT records and data blocks.

Few technical points:

* We're taking a copy of the buffer, so Jeff's zero trick works safely, I think.
* We can use a different algorithm for big and small blocks, we just need a way to show we've done that, for example setting the high order bit of the checksum.
* 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.

This work needs to happen now, since once the checksum algorithm is set we won't easily be able to change it.

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

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

Предыдущее
От: Ants Aasma
Дата:
Сообщение: Re: Enabling Checksums
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: [BUGS] replication_timeout not effective