Re: Add pg_buffercache_mark_dirty[_all] functions to the pg_buffercache - Mailing list pgsql-hackers

From 邱宇航
Subject Re: Add pg_buffercache_mark_dirty[_all] functions to the pg_buffercache
Date
Msg-id D5BB1D85-0F2A-419F-A7B1-426505525D3A@gmail.com
Whole thread Raw
In response to Add pg_buffercache_mark_dirty[_all] functions to the pg_buffercache  (Nazir Bilal Yavuz <byavuz81@gmail.com>)
Responses Re: Add pg_buffercache_mark_dirty[_all] functions to the pg_buffercache
List 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




pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: Row pattern recognition
Next
From: Bykov Ivan
Date:
Subject: IPC/MultixactCreation on the Standby server