Re: Add pg_buffercache_mark_dirty[_all] functions to the pg_buffercache

From: 邱宇航 <iamqyh(at)gmail(dot)com>
To: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Add pg_buffercache_mark_dirty[_all] functions to the pg_buffercache
Date: 2025-11-24 06:51:36
Message-ID: D5BB1D85-0F2A-419F-A7B1-426505525D3A@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I suggest using a conditional lock on the buffer, which would be more
appropriate here. Additionally, the function should return whether
the buffer is marked as dirty, the number of buffers marked as dirty.

This change would also make pg_buffercache_mark_dirty_{relation, all}
behave more consistently with pg_buffercache_evict_{relation,all}.

Lastly, `CHECK_FOR_INTERRUPTS()` should be added inside the loop over
`NBuffers` to ensure it can be interrupted during long-running
operations.

Best regards,
Yuhang Qiu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bykov Ivan 2025-11-24 07:09:39 IPC/MultixactCreation on the Standby server
Previous Message Tatsuo Ishii 2025-11-24 06:47:03 Re: Row pattern recognition