pgsql: Fix crash in WAL sender when starting physical replication - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Fix crash in WAL sender when starting physical replication
Date
Msg-id E1ji6Lx-0002bU-M9@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix crash in WAL sender when starting physical replication

Since database connections can be used with WAL senders in 9.4, it is
possible to use physical replication.  This commit fixes a crash when
starting physical replication with a WAL sender using a database
connection, caused by the refactoring done in 850196b.

There have been discussions about forbidding the use of physical
replication in a database connection, but this is left for later,
taking care only of the crash new to 13.

While on it, add a test to check for a failure when attempting logical
replication if the WAL sender does not have a database connection.  This
part is extracted from a larger patch by Kyotaro Horiguchi.

Reported-by: Vladimir Sitnikov
Author: Michael Paquier, Kyotaro Horiguchi
Reviewed-by: Kyotaro Horiguchi, Álvaro Herrera
Discussion: https://postgr.es/m/CAB=Je-GOWMj1PTPkeUhjqQp-4W3=nW-pXe2Hjax6rJFffB5_Aw@mail.gmail.com
Backpatch-through: 13

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/10ffe0fa72ed895a3c18aef2d3950b480e810e13

Modified Files
--------------
src/backend/access/transam/xlogreader.c     |  4 ++-
src/backend/replication/walsender.c         | 38 ++++++++++++++---------------
src/include/access/xlogreader.h             |  4 ---
src/test/recovery/t/006_logical_decoding.pl | 11 ++++++++-
4 files changed, 31 insertions(+), 26 deletions(-)


pgsql-committers by date:

Previous
From: Noah Misch
Date:
Subject: pgsql: MSVC: Avoid warning when testing a TAP suite without PROVE_FLAGS
Next
From: Thomas Munro
Date:
Subject: pgsql: Doc: Update example symptom of systemd misconfiguration.