Re: [HACKERS] GSoC 2017 : Patch for predicate locking in Gist index - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: [HACKERS] GSoC 2017 : Patch for predicate locking in Gist index
Date
Msg-id 3496ace5-a5bf-8b36-a177-53c24b118e77@iki.fi
Whole thread Raw
In response to [HACKERS] GSoC 2017 : Patch for predicate locking in Gist index  (Shubham Barai <shubhambaraiss@gmail.com>)
Responses Re: [HACKERS] GSoC 2017 : Patch for predicate locking in Gist index
Re: [HACKERS] GSoC 2017 : Patch for predicate locking in Gist index
List pgsql-hackers
On 06/16/2017 01:24 PM, Shubham Barai wrote:
> @@ -497,6 +499,13 @@ gistplacetopage(Relation rel, Size freespace, GISTSTATE *giststate,
>              for (ptr = dist->next; ptr; ptr = ptr->next)
>                  UnlockReleaseBuffer(ptr->buffer);
>          }
> +
> +        for (ptr = dist; ptr; ptr = ptr->next)
> +            PredicateLockPageSplit(rel,
> +                        BufferGetBlockNumber(buffer),
> +                        BufferGetBlockNumber(ptr->buffer));
> +
> +

I think this new code needs to go before the UnlockReleaseBuffer() calls 
above. Calling BufferGetBlockNumber() on an already-released buffer is 
not cool.

- Heikki




pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: [HACKERS] Regarding Postgres Dynamic Shared Memory (DSA)
Next
From: Heikki Linnakangas
Date:
Subject: Re: [HACKERS] GSoC 2017 : Patch for predicate locking in Gist index