pgsql: Fix deadlock with LWLockAcquireWithVar and LWLockWaitForVar.

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Fix deadlock with LWLockAcquireWithVar and LWLockWaitForVar.
Дата
Msg-id E1XdwJT-0004sj-Ul@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix deadlock with LWLockAcquireWithVar and LWLockWaitForVar.

LWLockRelease should release all backends waiting with LWLockWaitForVar,
even when another backend has already been woken up to acquire the lock,
i.e. when releaseOK is false. LWLockWaitForVar can return as soon as the
protected value changes, even if the other backend will acquire the lock.
Fix that by resetting releaseOK to true in LWLockWaitForVar, whenever
adding itself to the wait queue.

This should fix the bug reported by MauMau, where the system occasionally
hangs when there is a lot of concurrent WAL activity and a checkpoint.
Backpatch to 9.4, where this code was added.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/e0d97d77bf0875e4d5cc7dedfe701d9999bf678c

Modified Files
--------------
src/backend/storage/lmgr/lwlock.c |    6 ++++++
1 file changed, 6 insertions(+)


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix typo in docs.
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Don't let protected variable access to be reordered after spinlo