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

Commit276bea2

Browse files
committed
Ensure that seqscans check for interrupts at least once per page.
If a seqscan encounters many consecutive pages containing only dead tuples,it can remain in the loop in heapgettup for a long time, and there was noCHECK_FOR_INTERRUPTS anywhere in that loop. This meant there werereal-world situations where a query would be effectively uncancelable forlong stretches. Add a check placed to occur once per page, which should beenough to provide reasonable response time without adding any measurableoverhead.Report and patch by Merlin Moncure (though I tweaked it a bit).Back-patch to all supported branches.
1 parentae7c8b2 commit276bea2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎src/backend/access/heap/heapam.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@ heapgetpage(HeapScanDesc scan, BlockNumber page)
219219
scan->rs_cbuf=InvalidBuffer;
220220
}
221221

222+
/*
223+
* Be sure to check for interrupts at least once per page. Checks at
224+
* higher code levels won't be able to stop a seqscan that encounters
225+
* many pages' worth of consecutive dead tuples.
226+
*/
227+
CHECK_FOR_INTERRUPTS();
228+
222229
/* read page using selected strategy */
223230
scan->rs_cbuf=ReadBufferExtended(scan->rs_rd,MAIN_FORKNUM,page,
224231
RBM_NORMAL,scan->rs_strategy);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp