Re: Wrong statistics for size of XLOG_SWITCH during pg_waldump.

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Wrong statistics for size of XLOG_SWITCH during pg_waldump.
Дата
Msg-id 20201014065243.GA12403@paquier.xyz
обсуждение исходный текст
Ответ на Re: Wrong statistics for size of XLOG_SWITCH during pg_waldump.  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-hackers
On Wed, Oct 14, 2020 at 10:29:44AM +0900, Kyotaro Horiguchi wrote:
> The reason is the function XLogDumpRecordLen is a common function
> among all kind of LOG records, not belongs only to XLOG_SWICH. And the
> junk_len is not useful for other than XLOG_SWITCH.  Descriptions
> specifc to XLOG_SWITCH is provided by xlog_desc().

Yeah.  In its current shape, it means that only pg_waldump would be
able to know this information.  If you make this information part of
xlogdesc.c, any consumer of the WAL record descriptions would be able
to show this information, so it would provide a consistent output for
any kind of tools.

On top of that, it seems to me that the calculation used in the patch
is wrong in two aspects at quick glance:
1) startSegNo and endSegNo point always to two different segments with
a XLOG_SWITCH record, so you should check that ReadRecPtr is not at a
segment border instead before extracting SizeOfXLogLongPHD, no?
2) This stuff should also check after the case of a WAL *page* border
where you'd need to adjust based on SizeOfXLogShortPHD instead.
--
Michael

Вложения

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

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: partition routing layering in nodeModifyTable.c
Следующее
От: Luc Vlaming
Дата:
Сообщение: Re: Use list_delete_xxxcell O(1) instead of list_delete_ptr O(N) in some places