Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY

Поиск
Список
Период
Сортировка
От Michail Nikolaev
Тема Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY
Дата
Msg-id CANtu0oixyt18rrZXNkMNKghgvs_1xHs5RovBmOhXF5K8J-9PuA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY
Список pgsql-hackers
Hello, Michael!

> This is a non-fresh Friday-afternoon idea, but it would make sure that
> we don't have any transactions using the indexes switched to _ccold
> with indisvalid that are waiting for a drop in phase 5.  Your tests
> seem to pass with that, and that keeps the operation intact
> concurrent-wise (I'm really wishing for isolation tests with injection
> points just now, because I could use them here).

Yes, I also have tried that approach, but it doesn't work, unfortunately.
You may fail test increasing number of connections:

'--no-vacuum --client=10 -j 2 --transactions=1000',

The source of the issue is not the swap of the indexes (and not related to REINDEX CONCURRENTLY only), but the fact that indexes are fetched once during planning (to find the arbiter), but then later reread with a new catalog snapshot for the the actual execution.

So, other possible fixes I see:
* fallback to replanning in case we see something changed during the execution
* select arbiter indexes during actual execution

> That's a HEAD-only thing IMO,
> though.
Do you mean that it needs to be moved to a separate patch?

Best regards,
Mikhail.

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

Предыдущее
От: Jelte Fennema-Nio
Дата:
Сообщение: libpq: Fix lots of discrepancies in PQtrace
Следующее
От: Markus Winand
Дата:
Сообщение: Re: ON ERROR in json_query and the like