Add pg_buffercache_mark_dirty[_all] functions to the pg_buffercache

From: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Aidar Imamov <a(dot)imamov(at)postgrespro(dot)ru>, Joseph Koshakow <koshy44(at)gmail(dot)com>
Subject: Add pg_buffercache_mark_dirty[_all] functions to the pg_buffercache
Date: 2025-04-11 09:13:41
Message-ID: CAN55FZ3ddSvxVDbBoNpc2JCCs0zf6g2X--zyHkr3xgUsHU51kA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

There is another thread [1] to add both pg_buffercache_evict_[relation
| all] and pg_buffercache_mark_dirty[_all] functions to the
pg_buffercache. I decided to create another thread as
pg_buffercache_evict_[relation | all] functions are committed but
pg_buffercache_mark_dirty[_all] functions still need review.

pg_buffercache_mark_dirty(): This function takes a buffer id as an
argument and tries to mark this buffer as dirty. Returns true on
success.
pg_buffercache_mark_dirty_all(): This is very similar to the
pg_buffercache_mark_dirty() function. The difference is
pg_buffercache_mark_dirty_all() does not take an argument. Instead it
just loops over the shared buffers and tries to mark all of them as
dirty. It returns the number of buffers marked as dirty.

Since that patch is targeted for the PG 19, pg_buffercache is bumped to v1.7.

Latest version is attached and people who already reviewed the patches are CCed.

[1] postgr.es/m/CAN55FZ0h_YoSqqutxV6DES1RW8ig6wcA8CR9rJk358YRMxZFmw%40mail.gmail.com

--
Regards,
Nazir Bilal Yavuz
Microsoft

Attachment Content-Type Size
v7-0001-Add-pg_buffercache_mark_dirty-_all-functions-for-.patch text/x-patch 15.9 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Antonin Houska 2025-04-11 09:25:22 Re: why there is not VACUUM FULL CONCURRENTLY?
Previous Message Fujii Masao 2025-04-11 09:05:14 Re: Correct documentation for protocol version