Getting rid of "tuple concurrently updated" elog()s with concurrentDDLs (at least ALTER TABLE)

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Getting rid of "tuple concurrently updated" elog()s with concurrentDDLs (at least ALTER TABLE)
Дата
Msg-id 20171226045503.GA17182@paquier.xyz
обсуждение исходный текст
Ответы Re: Getting rid of "tuple concurrently updated" elog()s with concurrent DDLs (at least ALTER TABLE)  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Hi all,

Triggering "tuple concurrently updated" from heapam.c, which is an elog(),
is not that difficult for some DDL commands. For example with ALTER ROLE,
just create a role:
psql --no-psqlrc -c 'create role popo'

And then run that in two sessions and the error will show up, triggered
from CatalogTupleUpdate():
while true; do psql --no-psqlrc -c "alter role popo password 'foo'"; done

In this case, upgrading the lock taken on pg_authid from RowExclusiveLock
to ShareRowExclusiveLock prevents concurrent sessions to update each other,
which is what the patch attached does.

I think that we should get rid of all those errors, for many applications
doing concurrent DDLs getting this error is surprising, and could be thought
as a corrupted instance. I am just touching the tip of the iceberg here, as
I have the gut feeling that there are other objects where it is possible to
trigger the failure, and an analysis effort is going to be costly. So I'd
like to get first the temperature about such analysis.

So, opinions?
--
Michael

Вложения

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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: AS OF queries
Следующее
От: Jeff Janes
Дата:
Сообщение: Deadlock in multiple CIC.