Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8e167e6

Browse files
nbtree: refine _bt_readnextpage contract comments.
Another minor follow-up commit for commit 1bd4bc8, which changed the _bt_readnextpage contract.
1 parent 088f8e2 commit 8e167e6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/access/nbtree/nbtsearch.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2183,7 +2183,9 @@ _bt_readfirstpage(IndexScanDesc scan, OffsetNumber offnum, ScanDirection dir)
21832183
* scan. A seized=false caller's blkno can never be assumed to be the page
21842184
* that must be read next during a parallel scan, though. We must figure that
21852185
* part out for ourselves by seizing the scan (the correct page to read might
2186-
* already be beyond the seized=false caller's blkno during a parallel scan).
2186+
* already be beyond the seized=false caller's blkno during a parallel scan,
2187+
* unless blkno/so->currPos.nextPage/so->currPos.prevPage is already P_NONE,
2188+
* or unless so->currPos.moreRight/so->currPos.moreLeft is already unset).
21872189
*
21882190
* On success exit, so->currPos is updated to contain data from the next
21892191
* interesting page, and we return true. We hold a pin on the buffer on
@@ -2204,6 +2206,7 @@ _bt_readnextpage(IndexScanDesc scan, BlockNumber blkno,
22042206
BTScanOpaque so = (BTScanOpaque) scan->opaque;
22052207

22062208
Assert(so->currPos.currPage == lastcurrblkno || seized);
2209+
Assert(!(blkno == P_NONE && seized));
22072210
Assert(!BTScanPosIsPinned(so->currPos));
22082211

22092212
/*

0 commit comments

Comments
 (0)