pgsql: Fix bogus when-to-deregister-from-listener-array logic.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix bogus when-to-deregister-from-listener-array logic.
Дата
Msg-id E1U5gRp-0004QI-2W@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix bogus when-to-deregister-from-listener-array logic.

Since a backend adds itself to the global listener array during
Exec_ListenPreCommit, it's inappropriate for it to remove itself during
Exec_UnlistenCommit or Exec_UnlistenAllCommit --- that leads to failure
when committing a transaction that did UNLISTEN then LISTEN, since we end
up not registered though we should be.  (This leads to missing later
notifications, or to Assert failures in assert-enabled builds.)  Instead
deal with deregistering at the bottom of AtCommit_Notify, when we know the
final state of the listenChannels list.

Also, simplify the representation of registration status by replacing the
transient backendHasExecutedInitialListen flag with an amRegisteredListener
flag.

Per report from Greg Sabino Mullane.  Back-patch to 9.0, where the problem
was introduced during the LISTEN/NOTIFY rewrite.

Branch
------
master

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

Modified Files
--------------
src/backend/commands/async.c |   60 +++++++++++++++--------------------------
1 files changed, 22 insertions(+), 38 deletions(-)


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Update visibility map in the second phase of vacuum.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix bogus when-to-deregister-from-listener-array logic.