Skip to content

Commit eb9ee4d

Browse files
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 <satyanarlapuram@gmail.com> Discussion: https://postgr.es/m/CAHg+QDcejeLx7WunFT3DX6XKh1KshvGKa8F5au8xVhqVvvQPRw@mail.gmail.com Backpatch-through: 13
1 parent e411371 commit eb9ee4d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

contrib/pg_buffercache/pg_buffercache_pages.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "access/htup_details.h"
1212
#include "catalog/pg_type.h"
1313
#include "funcapi.h"
14+
#include "miscadmin.h"
1415
#include "storage/buf_internals.h"
1516
#include "storage/bufmgr.h"
1617

@@ -148,6 +149,8 @@ pg_buffercache_pages(PG_FUNCTION_ARGS)
148149
BufferDesc *bufHdr;
149150
uint32 buf_state;
150151

152+
CHECK_FOR_INTERRUPTS();
153+
151154
bufHdr = GetBufferDescriptor(i);
152155
/* Lock each buffer header before inspecting. */
153156
buf_state = LockBufHdr(bufHdr);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy