Skip to content

Commit bd4ae0f

Browse files
committed
Add interrupt checks to contrib/pg_prewarm.
Currently the extension's pg_prewarm() function didn't check interrupts once it started "warming" data. Since individual calls can take a long while it's important for them to be interruptible. Backpatch to 9.4 where pg_prewarm was introduced.
1 parent 28245b8 commit bd4ae0f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

contrib/pg_prewarm/pg_prewarm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ pg_prewarm(PG_FUNCTION_ARGS)
159159
*/
160160
for (block = first_block; block <= last_block; ++block)
161161
{
162+
CHECK_FOR_INTERRUPTS();
162163
PrefetchBuffer(rel, forkNumber, block);
163164
++blocks_done;
164165
}
@@ -177,6 +178,7 @@ pg_prewarm(PG_FUNCTION_ARGS)
177178
*/
178179
for (block = first_block; block <= last_block; ++block)
179180
{
181+
CHECK_FOR_INTERRUPTS();
180182
smgrread(rel->rd_smgr, forkNumber, block, blockbuffer);
181183
++blocks_done;
182184
}
@@ -190,6 +192,7 @@ pg_prewarm(PG_FUNCTION_ARGS)
190192
{
191193
Buffer buf;
192194

195+
CHECK_FOR_INTERRUPTS();
193196
buf = ReadBufferExtended(rel, forkNumber, block, RBM_NORMAL, NULL);
194197
ReleaseBuffer(buf);
195198
++blocks_done;

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