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

Commit8ae0f6a

Browse files
Add CHECK_FOR_INTERRUPTS in Evict{Rel,All}UnpinnedBuffers.
This commit adds CHECK_FOR_INTERRUPTS to the shared buffer iterationloops in EvictRelUnpinnedBuffers and EvictAllUnpinnedBuffers. Thesefunctions, used by pg_buffercache's pg_buffercache_evict_relation andpg_buffercache_evict_all, can now be interrupted during long-runningoperations.Backpatch to version 18, where these functions and their correspondingpg_buffercache functions were introduced.Author: Yuhang Qiu <iamqyh@gmail.com>Discussion:https://postgr.es/m/8DC280D4-94A2-4E7B-BAB9-C345891D0B78%40gmail.comBackpatch-through: 18
1 parentfdda78e commit8ae0f6a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎src/backend/storage/buffer/bufmgr.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6685,6 +6685,8 @@ EvictAllUnpinnedBuffers(int32 *buffers_evicted, int32 *buffers_flushed,
66856685
uint32buf_state;
66866686
boolbuffer_flushed;
66876687

6688+
CHECK_FOR_INTERRUPTS();
6689+
66886690
buf_state=pg_atomic_read_u32(&desc->state);
66896691
if (!(buf_state&BM_VALID))
66906692
continue;
@@ -6735,6 +6737,8 @@ EvictRelUnpinnedBuffers(Relation rel, int32 *buffers_evicted,
67356737
uint32buf_state=pg_atomic_read_u32(&(desc->state));
67366738
boolbuffer_flushed;
67376739

6740+
CHECK_FOR_INTERRUPTS();
6741+
67386742
/* An unlocked precheck should be safe and saves some cycles. */
67396743
if ((buf_state&BM_VALID)==0||
67406744
!BufTagMatchesRelFileLocator(&desc->tag,&rel->rd_locator))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp