pgsql: Don't clear pendingRecoveryConflicts at end of transaction

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Don't clear pendingRecoveryConflicts at end of transaction
Дата
Msg-id E1w05HM-003NCE-25@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Don't clear pendingRecoveryConflicts at end of transaction

Commit 17f51ea818 introduced a new pendingRecoveryConflicts field in
PGPROC to replace the various ProcSignals. The new field was cleared
in ProcArrayEndTransaction(), which makes sense for conflicts with
e.g. locks or buffer pins which are gone at end of transaction. But it
is not appropriate for conflicts on a database, or a logical slot.

Because of this, the 035_standby_logical_decoding.pl test was
occasionally getting stuck in the buildfarm. It happens if the startup
process signals recovery conflict with the logical slot just when the
walsender process using the slot calls ProcArrayEndTransaction().

To fix, don't clear pendingRecoveryConflicts in
ProcArrayEndTransaction(). We could still clear certain conflict
flags, like conflicts on locks, but we didn't try to do that before
commit 17f51ea818 either.

In the passing, fix a misspelled comment, and make
InitAuxiliaryProcess() to also clear pendingRecoveryConflicts. I don't
think aux processes can have recovery conflicts, but it seems best to
initialize the field and keep InitAuxiliaryProcess() as close to
InitProcess() as possible.

Analyzed-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://www.postgresql.org/message-id/3e07149d-060b-48a0-8f94-3d5e4946ae45@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/138592d1b06634b85d4b0275ba6501676bb8113a

Modified Files
--------------
src/backend/storage/ipc/procarray.c | 7 +------
src/backend/storage/lmgr/proc.c     | 1 +
2 files changed, 2 insertions(+), 6 deletions(-)


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