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

Commitcaca6d8

Browse files
Assert consistency of currPage that ended scan.
When _bt_readnextpage is called with our nbtree parallel scan alreadyseized (i.e. when it is directly called by _bt_first), we never expect aprior call to _bt_readpage for lastcurrblkno to already indicate thatthe scan should end -- the _bt_first caller's blkno must always be read.After all, the "prior" _bt_readpage call (the call for lastcurrblkno)probably took place in some other backend (and it might not even havefinished by the time our backend reaches _bt_first/_bt_readnextpage).Add a documenting assertion to the path where _bt_readnextpage ends theparallel scan based on information about lastcurrblkno from so->currPos.Assert that the most recent _bt_readpage call that set so->currPos is infact lastcurrblkno's _bt_readpage call.Follow-up to bugfix commitb5ee4e5.
1 parent4225276 commitcaca6d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2230,8 +2230,9 @@ _bt_readnextpage(IndexScanDesc scan, BlockNumber blkno,
22302230
!so->currPos.moreRight : !so->currPos.moreLeft))
22312231
{
22322232
/* most recent _bt_readpage call (for lastcurrblkno) ended scan */
2233+
Assert(so->currPos.currPage==lastcurrblkno&& !seized);
22332234
BTScanPosInvalidate(so->currPos);
2234-
_bt_parallel_done(scan);
2235+
_bt_parallel_done(scan);/* iff !so->needPrimScan */
22352236
return false;
22362237
}
22372238

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp