Thread

Commits

  1. Fix GiST README's explanation of the NSN cross-check.

  1. Fix GIST readme on LSN vs NSN

    Heikki Linnakangas <hlinnaka@iki.fi> — 2023-09-18T11:09:43Z

    The GiST README says:
    
    > If the F_FOLLOW_RIGHT flag is not set, a scan compares the NSN on the
    > child and the LSN it saw in the parent. If NSN < LSN, the scan looked
    > at the parent page before the downlink was inserted, so it should
    > follow the rightlink. Otherwise the scan saw the downlink in the
    > parent page, and will/did follow that as usual.
    
    While the code does this (in gistget.c):
    
    > 	if (!XLogRecPtrIsInvalid(pageItem->data.parentlsn) &&
    > 		(GistFollowRight(page) ||
    > 		 pageItem->data.parentlsn < GistPageGetNSN(page)) &&
    > 		opaque->rightlink != InvalidBlockNumber /* sanity check */ )
    > 	{
    > 		/* There was a page split, follow right link to add pages */
    
    Note the comparison on LSN and NSN. The code seems correct, but the 
    README got it backwards.
    
    The narrow fix would be to change the "NSN < LSN" to "LSN < NSN" in the 
    README. But I propose the attached patch to reword the sentence a little 
    more.
    
    -- 
    Heikki Linnakangas
    Neon (https://neon.tech)
  2. Re: Fix GIST readme on LSN vs NSN

    Daniel Gustafsson <daniel@yesql.se> — 2023-09-18T11:53:28Z

    > On 18 Sep 2023, at 13:09, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
    
    > I propose the attached patch to reword the sentence a little more.
    
    LGTM, +1
    
    --
    Daniel Gustafsson
    
    
    
    
    
  3. Re: Fix GIST readme on LSN vs NSN

    Heikki Linnakangas <hlinnaka@iki.fi> — 2023-09-19T08:57:58Z

    On 18/09/2023 14:53, Daniel Gustafsson wrote:
    >> On 18 Sep 2023, at 13:09, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
    > 
    >> I propose the attached patch to reword the sentence a little more.
    > 
    > LGTM, +1
    
    Committed, thanks!
    
    -- 
    Heikki Linnakangas
    Neon (https://neon.tech)