Re: amcheck verification for GiST
От | Andrey Borodin |
---|---|
Тема | Re: amcheck verification for GiST |
Дата | |
Msg-id | 250A39F1-29F1-4275-AE4E-ADE8324820B2@yandex-team.ru обсуждение исходный текст |
Ответ на | Re: amcheck verification for GiST (Andrey Borodin <x4mmm@yandex-team.ru>) |
Ответы |
Re: amcheck verification for GiST
|
Список | 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 по дате отправления: