Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY
От | Michail Nikolaev |
---|---|
Тема | Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY |
Дата | |
Msg-id | CANtu0oj4RgWKJi-id5enjB1AtkRuAg_x18uS6kwYaS5xeYLuCA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY (Michail Nikolaev <michail.nikolaev@gmail.com>) |
Ответы |
Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY
|
Список | pgsql-hackers |
Hello.
> But I was unable to reproduce that using some random usleep(), however - maybe it is a wrong assumption.
It seems like the assumption is correct - we may use an invalid index as arbiter due to race condition.
The attached patch adds a check for that case, and now the test fails like this:
# pgbench: error: client 16 script 1 aborted in command 1 query 0: ERROR: duplicate key value violates unique constraint "tbl_pkey_ccold"
# DETAIL: Key (i)=(42) already exists.
# pgbench: error: client 9 script 1 aborted in command 1 query 0: ERROR: ON CONFLICT does not support invalid indexes as arbiters
# pgbench: error: client 0 script 2 aborted in command 1 query 0: ERROR: duplicate key value violates unique constraint "tbl_pkey"
# DETAIL: Key (i)=(69) already exists.
# pgbench: error: client 7 script 0 aborted in command 1 query 0: ERROR: ON CONFLICT does not support invalid indexes as arbiters
# pgbench: error: client 10 script 0 aborted in command 1 query 0: ERROR: ON CONFLICT does not support invalid indexes as arbiters
# pgbench: error: client 11 script 0 aborted in command 1 query 0: ERROR: ON CONFLICT does not support invalid indexes as arbiters
# DETAIL: Key (i)=(42) already exists.
# pgbench: error: client 9 script 1 aborted in command 1 query 0: ERROR: ON CONFLICT does not support invalid indexes as arbiters
# pgbench: error: client 0 script 2 aborted in command 1 query 0: ERROR: duplicate key value violates unique constraint "tbl_pkey"
# DETAIL: Key (i)=(69) already exists.
# pgbench: error: client 7 script 0 aborted in command 1 query 0: ERROR: ON CONFLICT does not support invalid indexes as arbiters
# pgbench: error: client 10 script 0 aborted in command 1 query 0: ERROR: ON CONFLICT does not support invalid indexes as arbiters
# pgbench: error: client 11 script 0 aborted in command 1 query 0: ERROR: ON CONFLICT does not support invalid indexes as arbiters
I think It is even possible to see !alive index in the same situation (it is worse case), but I was unable to reproduce it so far.
Best regards,
Mikhail.
Вложения
В списке pgsql-hackers по дате отправления: