pgsql: Fix signal handling in logical replication workers

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix signal handling in logical replication workers
Date: 2017-06-02 18:51:00
Message-ID: E1dGrf2-0006mF-N8@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix signal handling in logical replication workers

The logical replication worker processes now use the normal die()
handler for SIGTERM and CHECK_FOR_INTERRUPTS() instead of custom code.
One problem before was that the apply worker would not exit promptly
when a subscription was dropped, which could lead to deadlocks.

Author: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>
Reported-by: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9fcf670c2efdf31233d429f557ab77937f0f1e6a

Modified Files
--------------
src/backend/replication/logical/launcher.c | 16 +++++++-------
src/backend/replication/logical/tablesync.c | 10 ++++-----
src/backend/replication/logical/worker.c | 34 ++++++++++++++++++++++++++---
src/backend/tcop/postgres.c | 5 +++++
src/include/replication/logicalworker.h | 2 ++
src/include/replication/worker_internal.h | 4 ----
6 files changed, 50 insertions(+), 21 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2017-06-02 19:25:44 pgsql: doc: Add note that DROP SUBSCRIPTION drops replication slot
Previous Message Magnus Hagander 2017-06-02 09:19:01 pgsql: Fix copy/paste mistake in comment