Re: Moving RestoreBlockImage from xlogreader.c to xlogutils.c

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Moving RestoreBlockImage from xlogreader.c to xlogutils.c
Дата
Msg-id CAB7nPqTmkGEO+eyRic=YuEa8UNCiCG++1p_e0rrDb=G2Yq04dA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Moving RestoreBlockImage from xlogreader.c to xlogutils.c  (Fujii Masao <masao.fujii@gmail.com>)
Ответы Re: Moving RestoreBlockImage from xlogreader.c to xlogutils.c  (Fujii Masao <masao.fujii@gmail.com>)
Список pgsql-hackers
On Wed, Dec 24, 2014 at 10:16 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
> On Wed, Dec 24, 2014 at 9:42 PM, Michael Paquier
> <michael.paquier@gmail.com> wrote:
>> Wouldn't it be better to declare it as a static routine in
>> xlogutils.c? If we keep it in xlogreader.c, I think that we should at
>> least wrap it with ifndef FRONTEND.
>
> If we do this, pg_lzcompress.c doesn't need to be moved to common for
> FPW compression patch which we're talking about in other thread. Right?
Yes. This refactoring came to my mind while re-thinking about the WAL
compression. This would also make more straight-forward the
implementation of hooks for compression and decompression.

> DecodeXLogRecord() seems also a backend-only, so we should treat it
> in the same way as you proposed? Or pg_rewind uses that?
DecodeXLogRecord is used by XLogReadRecord, the latter being called by
pg_xlogdump and also pg_rewind, so it is not backend-only. IMO, only
exposing to the frontends the pointer to the beginning of the block
image in the decoder with its extra data, like hole length and hole
offset (or block length in record with WAL compression, be it
compressed or uncompressed), is just but fine. It looks weird to keep
in the xlog reader facility something that performs other operations
than reading a WAL record and organizing it in a readable state for
caller.
-- 
Michael



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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: Moving RestoreBlockImage from xlogreader.c to xlogutils.c
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: Moving RestoreBlockImage from xlogreader.c to xlogutils.c