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

Commit8ce29bb

Browse files
author
Amit Kapila
committed
Fix the buffer release order for parallel index scans.
During parallel index scans, if the current page to be read is deleted, weskip it and try to get the next page for a scan without releasing the bufferlock on the current page. To get the next page, sometimes it needs to waitfor another process to complete its scan and advance it to the next page.Now, it is quite possible that the master backend has errored out beforeadvancing the scan and issued a termination signal for all workers. Theworkers failed to notice the termination request during wait because theinterrupts are held due to buffer lock on the previous page. This lead toall workers being stuck.The fix is to release the buffer lock on current page before trying to getthe next page. We are already doing same in backward scans, but missedit for forward scans.Reported-by: Victor YegorovBug: 15290Diagnosed-by: Thomas Munro and Amit KapilaAuthor: Amit KapilaReviewed-by: Thomas MunroTested-By: Thomas Munro and Victor YegorovBackpatch-through: 10 where parallel index scans were introducedDiscussion:https://postgr.es/m/153228422922.1395.1746424054206154747@wrigleys.postgresql.org
1 parent39d51fe commit8ce29bb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/backend/access/nbtree/nbtsearch.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,17 +1497,19 @@ _bt_readnextpage(IndexScanDesc scan, BlockNumber blkno, ScanDirection dir)
14971497
/* nope, keep going */
14981498
if (scan->parallel_scan!=NULL)
14991499
{
1500+
_bt_relbuf(rel,so->currPos.buf);
15001501
status=_bt_parallel_seize(scan,&blkno);
15011502
if (!status)
15021503
{
1503-
_bt_relbuf(rel,so->currPos.buf);
15041504
BTScanPosInvalidate(so->currPos);
15051505
return false;
15061506
}
15071507
}
15081508
else
1509+
{
15091510
blkno=opaque->btpo_next;
1510-
_bt_relbuf(rel,so->currPos.buf);
1511+
_bt_relbuf(rel,so->currPos.buf);
1512+
}
15111513
}
15121514
}
15131515
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp