Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbd4ae0f

Browse files
committed
Add interrupt checks to contrib/pg_prewarm.
Currently the extension's pg_prewarm() function didn't checkinterrupts once it started "warming" data. Since individual calls cantake a long while it's important for them to be interruptible.Backpatch to 9.4 where pg_prewarm was introduced.
1 parent28245b8 commitbd4ae0f

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
Bufferbuf;
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)

[8]ページ先頭

©2009-2025 Movatter.jp