Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY

Поиск
Список
Период
Сортировка
От Mihail Nikalayeu
Тема Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY
Дата
Msg-id CADzfLwWLe9tYQZuK9CHTN+rHS4V64wjfhOuJnyXtPSVBhQUmtw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY  (Álvaro Herrera <alvherre@kurilemu.de>)
Ответы Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY
Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY
Список pgsql-hackers
Hello, Álvaro!

Thanks for your review!

> Actually, about this fragment ... if we track these ancestors for all
> indexes, not just the ones that we consider as arbiters, don't we risk
> doing something stupid when a completely unrelated index is being
> reindexed?  Namely, also consider that unrelated index as arbiter.

Yes, such a thing may happen. It will not cause any error, because such an index will be used as artiber only if another compatible index in that same relation is present.
And additional_arbiters will be incremented.

> I think the lappend_oid(ancestors_seen) should happen inside the
>  "if list_member_oid(ancestors)" block instead.

But yes, it is a more clear way. Added to v3.

> I'm also missing a comment for why the use linitial_oid(ancestors) is
> correct.  At first I thought we should walk the entire ancestors list,
> and do this dance if any OID there matches the ancestors_seen list.  I
> convinced myself that this isn't necessary because the scenario is a
> single table being under REINDEX CONCURRENTLY, so the two indexes would
> have the same root relation (top-most ancestor index).  So comparing
> linitial() is correct.

Probably you think linitial() is "root", but it is an immediate parent.
I am not sure I understood you correctly, but I added a comment about it.
And about the opposite race + assert (not sure we need to keep it).

Best regards,
Mikhail.

Вложения

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