Re: Avoiding deadlock errors in CREATE INDEX CONCURRENTLY

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Avoiding deadlock errors in CREATE INDEX CONCURRENTLY
Дата
Msg-id 8370.1560094597@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Avoiding deadlock errors in CREATE INDEX CONCURRENTLY  ("Goel, Dhruv" <goeldhru@amazon.com>)
Ответы Re: Avoiding deadlock errors in CREATE INDEX CONCURRENTLY  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
"Goel, Dhruv" <goeldhru@amazon.com> writes:
> Yes, you are correct. The test case here was that if a tuple is inserted after the reference snapshot is taken in
Phase2 and before the index is marked ready. If this tuple is deleted before the reference snapshot of Phase 3, it will
nevermake it to the index. I have fixed this problem by making pg_index tuple updates transactional (I believe there is
noreason why it has to be in place now) so that the xmin of the pg_index tuple is same the xmin of the snapshot in
Phase3. 

I think you are mistaken that doing transactional updates in pg_index
is OK.  If memory serves, we rely on xmin of the pg_index row for purposes
such as detecting whether a concurrently-created index is safe to use yet.
So a transactional update would restart that clock and result in temporary
denial of service.

            regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Use of reloptions by EXTENSIONs
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Avoiding deadlock errors in CREATE INDEX CONCURRENTLY