Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()

Поиск
Список
Период
Сортировка
От Claudio Freire
Тема Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()
Дата
Msg-id CAGTBQpYZ8BvmGhQq2KN4jGMV_ARc90geXdHOteJZW_r1BiUouQ@mail.gmail.com
обсуждение исходный текст
Ответ на Changing WAL Header to reduce contention during ReserveXLogInsertLocation()  (Simon Riggs <simon@2ndquadrant.com>)
Ответы Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()
Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()
Список pgsql-hackers


On Sat, Dec 30, 2017 at 7:32 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
So we can't completely remove xl_prev field, without giving up some
functionality. But we don't really need to store the 8-byte previous
WAL pointer in order to detect torn pages. Something else which can
tell us that the WAL record does not belong to current WAL segno would
be enough as well. I propose that we replace it with a much smaller
2-byte field (let's call it xl_walid). The "xl_walid" (or whatever we
decide to call it) is the low order 16-bits of the WAL segno to which
the WAL record belongs. While reading WAL, we always match that the
"xl_walid" value stored in the WAL record matches with the current WAL
segno's lower order 16-bits and if not, then consider that as the end
of the stream.

For this to work, we must ensure that WAL files are either recycled in
such a way that the "xl_walid" of the previous (to be recycled) WAL
differs from the new WAL or we zero-out the new WAL file. Seems quite
easy to do with the existing infrastructure.

Or, you can use the lower 16-bits of the previous record's CRC


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Re: [COMMITTERS] pgsql: Remove pgbench "progress" test pending solution of its timing is (fwd)
Следующее
От: Claudio Freire
Дата:
Сообщение: Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()