pgsql: Fix deadlock at startup, if max_prepared_transactions is too sma

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Fix deadlock at startup, if max_prepared_transactions is too sma
Дата
Msg-id E1YlM3U-0001XC-SB@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix deadlock at startup, if max_prepared_transactions is too small.

When the startup process recovers transactions by scanning pg_twophase
directory, it should clear MyLockedGxact after it's done processing each
transaction. Like we do during normal operation, at PREPARE TRANSACTION.
Otherwise, if the startup process exits due to an error, it will try to
clear the locking_backend field of the last recovered transaction. That's
usually harmless, but if the error happens in MarkAsPreparing, while
holding TwoPhaseStateLock, the shmem-exit hook will try to acquire
TwoPhaseStateLock again, and deadlock with itself.

This fixes bug #13128 reported by Grant McAlister. The bug was introduced
by commit bb38fb0d, so backpatch to all supported versions like that
commit.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/2c47fe16a709e01dea403643a1ff4d00c8c8c1ad

Modified Files
--------------
src/backend/access/transam/twophase.c |    6 ++++++
1 file changed, 6 insertions(+)


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Fix shell error on Solaris
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix deadlock at startup, if max_prepared_transactions is too sma