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

Commit884a608

Browse files
committed
Fix parallel index scan hang with deleted or half-dead pages.
The previous coding forgot to release the scan before seizingit again, leading to a lockup.Report by Patrick Hemmer. Diagnosis by Thomas Munro. Patch byAmit Kapila.Discussion:http://postgr.es/m/CAEepm=2xZUcOGP9V0O_G0=2P2wwXwPrkF=upWTCJSisUxMnuSg@mail.gmail.com
1 parent1d6fb35 commit884a608

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,11 @@ _bt_readnextpage(IndexScanDesc scan, BlockNumber blkno, ScanDirection dir)
14861486
if (_bt_readpage(scan,dir,P_FIRSTDATAKEY(opaque)))
14871487
break;
14881488
}
1489+
elseif (scan->parallel_scan!=NULL)
1490+
{
1491+
/* allow next page be processed by parallel worker */
1492+
_bt_parallel_release(scan,opaque->btpo_next);
1493+
}
14891494

14901495
/* nope, keep going */
14911496
if (scan->parallel_scan!=NULL)
@@ -1581,6 +1586,11 @@ _bt_readnextpage(IndexScanDesc scan, BlockNumber blkno, ScanDirection dir)
15811586
if (_bt_readpage(scan,dir,PageGetMaxOffsetNumber(page)))
15821587
break;
15831588
}
1589+
elseif (scan->parallel_scan!=NULL)
1590+
{
1591+
/* allow next page be processed by parallel worker */
1592+
_bt_parallel_release(scan,BufferGetBlockNumber(so->currPos.buf));
1593+
}
15841594

15851595
/*
15861596
* For parallel scans, get the last page scanned as it is quite

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp