Re: Elimination of the repetitive code at the SLRU bootstrap functions.

Поиск
Список
Период
Сортировка
От Álvaro Herrera
Тема Re: Elimination of the repetitive code at the SLRU bootstrap functions.
Дата
Msg-id 202502171300.3p53vpgbytob@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: Elimination of the repetitive code at the SLRU bootstrap functions.  (Andrey Borodin <x4mmm@yandex-team.ru>)
Список pgsql-hackers
On 2025-Feb-17, Andrey Borodin wrote:

> BootStrapSlruPage() always calls zerofunc(pageno, false) with second argument false.
> In case of every possible argument (ZeroCLOGPage, ZeroCommitTsPage,
> ZeroMultiXactOffsetPage, ZeroMultiXactMemberPage, ZeroSUBTRANSPage) it
> means just a call to SimpleLruZeroPage().
> I think we can safely replace
> 
> + slotno = (*zerofunc)(pageno, false);
> 
> with
> 
> + slotno = SimpleLruZeroPage(pageno);
> 
> Thus we will not need zerofunc argument at all.

Good observation.  This also suggests another change: because this new
function is used not only for bootstrapping but also during WAL replay,
we can call the new function SimpleLruUnloggedZeroPage() and place it
immediately after SimpleLruZeroPage, instead of at the end of the file.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"La persona que no quería pecar / estaba obligada a sentarse
 en duras y empinadas sillas    / desprovistas, por cierto
 de blandos atenuantes"                          (Patricio Vogel)



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