From: Michael Paquier <michael@paquier.xyz>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: sitnikov.vladimir@gmail.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: SIGSEGV from START_REPLICATION 0/XXXXXXX in XLogSendPhysical () at walsender.c:2762
Date: Fri, 29 May 2020 16:21:38 +0900
Message-ID: <20200529072138.GG44192@paquier.xyz> (raw)
In-Reply-To: <20200528.181139.1631626601933187948.horikyota.ntt@gmail.com>
References: <CAB=Je-GOWMj1PTPkeUhjqQp-4W3=nW-pXe2Hjax6rJFffB5_Aw@mail.gmail.com>
<20200528.170436.1361384430172307883.horikyota.ntt@gmail.com>
<CAB=Je-HnFcwPUeLq5CXUqBnC7G7WeTi7DdGKbnFe-EizvnBJmw@mail.gmail.com>
<20200528.181139.1631626601933187948.horikyota.ntt@gmail.com>
On Thu, May 28, 2020 at 06:11:39PM +0900, Kyotaro Horiguchi wrote:
> Mmm. It is not the proper way to use physical replication and it's
> totally accidental that that worked (or even it might be a bug). The
> documentation is saying as the follows, as more-or-less the same for
> all versions since 9.4.
>
> https://www.postgresql.org/docs/13/protocol-replication.html
+ if (am_db_walsender)
+ ereport(ERROR,
+ (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+ errmsg("cannot initiate physical
replication on a logical replication connection")));
I don't agree with this change. The only restriction that we have in
place now in walsender.c regarding MyDatabaseId not being set is to
prevent the execution of SQL commands. Note that it is possible to
start physical replication even if MyDatabaseId is set in a
replication connection, so you could break cases that have been valid
until now.
I think that we actually should be much more careful with the
initialization of the WAL reader used in the context of a WAL sender
before calling WALRead() and attempting to read a new WAL page.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: michael@paquier.xyz, horikyota.ntt@gmail.com, sitnikov.vladimir@gmail.com
Subject: Re: SIGSEGV from START_REPLICATION 0/XXXXXXX in XLogSendPhysical () at walsender.c:2762
In-Reply-To: <20200529072138.GG44192@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox