Re: Amcheck: do rightlink verification with lock coupling

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Amcheck: do rightlink verification with lock coupling
Дата
Msg-id CAH2-WzkTRbmc0qgp_T9kNFAYBxvmzhm1Ek-5P_2XxNjay4y1-Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Amcheck: do rightlink verification with lock coupling  ("Andrey M. Borodin" <x4mmm@yandex-team.ru>)
Ответы Re: Amcheck: do rightlink verification with lock coupling  ("Andrey M. Borodin" <x4mmm@yandex-team.ru>)
Список pgsql-hackers
On Tue, Aug 4, 2020 at 9:33 AM Andrey M. Borodin <x4mmm@yandex-team.ru> wrote:
> BTW, reviewing this patch again I cannot understand why we verify link coherence only on leaf level but not for
internalpages?
 
> I do not see any actual problems here.

Well, I thought that it might be a good idea to limit it to the leaf
level, based on the theory that we rarely couple locks on internal
page levels in general. But yeah, that's probably not a good enough
reason to avoid lock coupling on internal pages. It's probably better
to do it everywhere than to explain why we don't do it on the internal
level -- the explanation will probably be confusing. And even if there
was a performance issue, it could only happen when there are
concurrent internal page splits -- but those are supposed to be rare.

Attached is v4, which now checks internal pages (just like leaf
pages). The main other change in this revised version is that we make
the error raised by bt_index_check() match the error used in the old
bt_index_parent_check() case -- we always want to blame the current
target page when amcheck complains (technically the page we blame when
the invariant fails isn't strictly guaranteed to be quite the same
thing as the target, but it's close enough to not really matter in
reality). Other adjustments:

* Added _bt_checkpage() calls for buffers, as is standard practice in nbtree.

* Added protection against locking the same page a second time in the
event of a faulty sibling link -- we should avoid a self-deadlock in
the event of a page that is corrupt in just the wrong way.

* Updated obsolescent comments that claimed that we never couple
buffer locks in amcheck.

I would like to commit something like this in the next day or two.

Thoughts?

--
Peter Geoghegan

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Replace remaining StrNCpy() by strlcpy()
Следующее
От: Alvaro Herrera
Дата:
Сообщение: PROC_IN_ANALYZE stillborn 13 years ago