Re: Assert in pageinspect with NULL pages

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Assert in pageinspect with NULL pages
Дата
Msg-id YjGjRMxZpCU8TpHb@paquier.xyz
обсуждение исходный текст
Ответ на Re: Assert in pageinspect with NULL pages  (Daria Lepikhova <d.lepikhova@postgrespro.ru>)
Ответы Re: Assert in pageinspect with NULL pages  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On Wed, Feb 23, 2022 at 12:09:02PM +0500, Daria Lepikhova wrote:
> And one more addition. In the previous version of the patch, I forgot to add
> tests for the gist index, but the described problem is also relevant for it.

So, I have looked at this second part of the thread, and concluded
that we should not fail for empty pages.  First, we fetch pages from
the buffer pool in normal mode, where empty pages are valid.  There is
also a second point in favor of doing so: code paths dedicated to hash
indexes already do that, marking such pages as simply "unused".  The
proposal from Julien upthread sounds cleaner to me though in the long
run, as NULL gives the user the possibility to do a full-table scan
with simple clauses to filter out anything found as NULL.

Painting more PageIsNew() across the place requires a bit more work
than a simple ereport(ERROR) in get_page_from_raw(), of course, but
the gain is the portability of the functions.

(One can have a lot of fun playing with random inputs and breaking
most code paths, but that's not new.)
--
Michael

Вложения

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

Предыдущее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Possible corruption by CreateRestartPoint at promotion
Следующее
От: Maxim Orlov
Дата:
Сообщение: Re: Add 64-bit XIDs into PostgreSQL 15