Add CHECK_FOR_INTERRUPTS in contrib/pg_buffercache functions.
authorMasahiko Sawada <[email protected]>
Tue, 19 Aug 2025 19:11:25 +0000 (12:11 -0700)
committerMasahiko Sawada <[email protected]>
Tue, 19 Aug 2025 19:11:25 +0000 (12:11 -0700)
commit7d8d36289f6a688c52004be16d657316c82ffb14
treec7bf40e47affe4066540bca93fa8e6ec16708f8f
parent0a98f24a65cdf8520b6b36154f8b425e85b78854
Add CHECK_FOR_INTERRUPTS in contrib/pg_buffercache functions.

This commit adds CHECK_FOR_INTERRUPTS to loops iterating over shared
buffers in several pg_buffercache functions, allowing them to be
interrupted during long-running operations.

Backpatch to all supported versions. Add CHECK_FOR_INTERRUPTS to the
loop in pg_buffercache_pages() in all supported branches, and to
pg_buffercache_summary() and pg_buffercache_usage_counts() in version
16 and newer.

Author: SATYANARAYANA NARLAPURAM <[email protected]>
Discussion: https://postgr.es/m/CAHg+QDcejeLx7WunFT3DX6XKh1KshvGKa8F5au8xVhqVvvQPRw@mail.gmail.com
Backpatch-through: 13
contrib/pg_buffercache/pg_buffercache_pages.c