pgsql: Add CHECK_FOR_INTERRUPTS in Evict{Rel,All}UnpinnedBuffers.

From: Masahiko Sawada <msawada(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add CHECK_FOR_INTERRUPTS in Evict{Rel,All}UnpinnedBuffers.
Date: 2025-11-04 23:48:51
Message-ID: E1vGQlf-0054Ba-2F@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add CHECK_FOR_INTERRUPTS in Evict{Rel,All}UnpinnedBuffers.

This commit adds CHECK_FOR_INTERRUPTS to the shared buffer iteration
loops in EvictRelUnpinnedBuffers and EvictAllUnpinnedBuffers. These
functions, used by pg_buffercache's pg_buffercache_evict_relation and
pg_buffercache_evict_all, can now be interrupted during long-running
operations.

Backpatch to version 18, where these functions and their corresponding
pg_buffercache functions were introduced.

Author: Yuhang Qiu <iamqyh(at)gmail(dot)com>
Discussion: https://postgr.es/m/8DC280D4-94A2-4E7B-BAB9-C345891D0B78%40gmail.com
Backpatch-through: 18

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8ae0f6a0c3da4b1568b753906eb8ea34d41da251

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 4 ++++
1 file changed, 4 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2025-11-05 00:49:41 pgsql: Special case C_COLLATION_OID in pg_newlocale_from_collation().
Previous Message Masahiko Sawada 2025-11-04 23:48:47 pgsql: Add CHECK_FOR_INTERRUPTS in Evict{Rel,All}UnpinnedBuffers.