Re: amcheck verification for GiST - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: amcheck verification for GiST
Date
Msg-id 250A39F1-29F1-4275-AE4E-ADE8324820B2@yandex-team.ru
Whole thread Raw
In response to Re: amcheck verification for GiST  (Andrey Borodin <x4mmm@yandex-team.ru>)
Responses Re: amcheck verification for GiST
List pgsql-hackers

> 28 марта 2019 г., в 18:35, Andrey Borodin <x4mmm@yandex-team.ru> написал(а):
>>
>> Is this really needed? Isn't the ShareLock on the index sufficient? If so, why?
> There may be concurrent inserts? In GiST they can reorder items on page.

Looks like I've tried to cope with same problem twice:
v3 of the patch used AccessShareLock and many locks with incorrect order.
We could use one of possible solutions: either use ShareLock, or rewrite scan to correct locking order.
But patches v4-v7 use both.
I think we should use AccessShareLock, as long as we implemented tricky logic with gist_refind_parent().


>>> +               stack->parenttup = gist_refind_parent(rel, stack->parentblk, stack->blkno, strategy);
>>
>> If the gistplacetopage() stuff is truly necessary, then is it okay to
>> call gist_refind_parent() with the original buffer lock still held
>> like this?
> When we call gist_refind_parent() we hold lock for a child and lock parent.
> We exclude concurrent VACUUM, thus parent cannot become a child for current child, because it has to be recycled for
suchcoincidence. 
That's merely hard form of paranoia, internal pages are never deleted. gist_index_parent_check() would work just fine
withconcurrent VACUUM, INSERTs and SELECTs. 

Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: propagating replica identity to partitions
Next
From: Simon Riggs
Date:
Subject: Re: propagating replica identity to partitions