introduce bufmgr hooks

Поиск
Список
Период
Сортировка
От Nathan Bossart
Тема introduce bufmgr hooks
Дата
Msg-id 20220829222449.GA540837@nathanxps13
обсуждение исходный текст
Ответы Re: introduce bufmgr hooks  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Re: introduce bufmgr hooks  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Hi hackers,

I'd like to propose some new hooks for the buffer manager.  My primary goal
is to allow users to create an additional caching mechanism between the
shared buffers and disk for evicted buffers.  For example, some EC2
instance classes have ephemeral disks that are physically attached to the
host machine that might be useful for such a cache.  Presumably there are
other uses (e.g., gathering more information about the buffer cache), but
this is the main use-case I have in mind.  I am proposing the following new
hooks:

 * bufmgr_read_hook: called in place of smgrread() in ReadBuffer_common().
   It is expected that such hooks would call smgrread() as necessary.

 * bufmgr_write_hook: called before smgrwrite() in FlushBuffer().  The hook
   indicateѕ whether the buffer is being evicted.  Hook functions must
   gracefully handle concurrent hint bit updates to the page.

 * bufmgr_invalidate_hook: called within InvalidateBuffer().

The attached patch is a first attempt at introducing these hooks with
acceptable names, placements, arguments, etc.

Thoughts?

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: windows resource files, bugs and what do we actually want
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: effective_multixact_freeze_max_age issue