Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jeZLI-0005ML-2a for pgsql-hackers@arkaria.postgresql.org; Fri, 29 May 2020 07:22:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jeZLG-0005EI-ID for pgsql-hackers@arkaria.postgresql.org; Fri, 29 May 2020 07:22:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jeZLG-0005EA-At for pgsql-hackers@lists.postgresql.org; Fri, 29 May 2020 07:22:10 +0000 Received: from [66.111.4.27] (helo=out3-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jeZLD-0003MS-2P for pgsql-hackers@postgresql.org; Fri, 29 May 2020 07:22:09 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 681BF5C0099; Fri, 29 May 2020 03:21:55 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 29 May 2020 03:21:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=vzWMIHx9tQocsn20WucQFFp/qJu ajW/Ny9/jzJKcgc8=; b=OFM+/8alNWBvPAn4pnBNI6wWozM36fbfhVXDNQaMBHf NfHWSW37Hy0Ee7ONmYmX+NX8qMfxxKStTe3xsBbkkU2z63p95G1vXz0OYqVh5mft oo4w3k+QB6NzNB4jkjWQO2TMCs7LX6X4W+wmLc6OXrxPIaUZytzbdjhPlRuXrCDU NTu6X0PmH6wCwlbh0JRgfLDhIa9bia7vIn4xOjO42WR/WulOH3rV3vXkuuGXONh3 nmz/eNGTg30JhSiREqvQxDgxCcuLKx4eP+4nu/y1081vLlECOqkAG63Vf/S6Zb8n 2Wa1++b+88edR3ISCS67BoScl9rWHRRP+glDhRhR0rA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=vzWMIH x9tQocsn20WucQFFp/qJuajW/Ny9/jzJKcgc8=; b=rAQWYNmDtaWOh1BqjPBAJi Ea3Zo6ZxtHnYYtbgI+Dm87h5SVd5XDMuk2BaIa6EGg8DzM6z9XLht+ZP0f7wGU41 /QdGbL8NuX67nWclGqvYi+14YtZlDEDyoWXGvwyyAeIUjx4tE2TUJc174ghLDZRP JQ1S6UIL7LSnO6AOdRy3S4aJ9BzR42huusdwii0pF4Tc7k2a1T8kuDMyPSYBSgdc 2W1H456cwuxNorBJR3aeHCdbIP0EJFnmhckk641fxiG0m6xXBhjKRnTqd7g/o4sy GT7Ud7cpKaGT7iIpk/YCkpl/2+sh2JHnLQpKVOWS/+iaYWPAorgx0z97onsKKzpQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddvjedguddutdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdefhedmnecujfgurhepff fhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghq uhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvg hrnhepffdufeeflefghfekudekkeevvddugfeiteekkeduleefvefhhffftdduffeiuedt necuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucfkphepudduuddruddtvd drudektddrudekheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 215F0306218B; Fri, 29 May 2020 03:21:51 -0400 (EDT) Date: Fri, 29 May 2020 16:21:38 +0900 From: Michael Paquier To: Kyotaro Horiguchi Cc: sitnikov.vladimir@gmail.com, pgsql-hackers@postgresql.org Subject: Re: SIGSEGV from START_REPLICATION 0/XXXXXXX in XLogSendPhysical () at walsender.c:2762 Message-ID: <20200529072138.GG44192@paquier.xyz> References: <20200528.170436.1361384430172307883.horikyota.ntt@gmail.com> <20200528.181139.1631626601933187948.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="G3juXO9GfR42w+sw" Content-Disposition: inline In-Reply-To: <20200528.181139.1631626601933187948.horikyota.ntt@gmail.com> X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.27 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --G3juXO9GfR42w+sw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > 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 --G3juXO9GfR42w+sw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl7QuAIACgkQnvQgOdby QH3XAg//VidnyzYhlRtcjuiQGXEPvS91f0SZ0SzPDMmD5skHnk43lPtnBOOOUQlg AtW/2upyCBm18yGJ5yS7aoXv6tDIzgJMbMnXaYfT3QqmuKJ+UFsNscxbuxqm5zCY 9mWsSuwpl/zYhQZ3TwLUSicf4b9y3eRl/W6eb2BxHv/kRvO9xbJgWj9kLJ4snK1u CJI7P1gs8eEdid+kZ92AbijOqpArA7tuAJ6+b3BDgzMBAu6UjdZaZGkZsTezj6nH iSS4fqForofrCPGrCAZ1yOdn982kgBaiUpXRRvqwLtK9BhgTLQhNCFLPI9Hnc098 nVjzjmoAwk0nXkcnCFTqkGa2DXHanaumGxu3V7SYZrWLeYpQ+JnybS2hnNZP1k0r nLXP8QYKhVgCHx4kmVlj4eMU4ri3ICaBj8vcZD1kWIKiXRJvsihTKx3Jd+GXjqUv F/OfPMLatI3qcLe+PPHdXwEW5dVBCkRcwbv2GozDnPcwU2djxy+Up2BL4v6OsSoK OPBW+ubpyzLOaG2grwFlWahmsTE0yHVFegjz3tej+Y8g/8Gg9Oo47jgXJPaafvLa 1muyuvpq6mhNEuDBMSd+pldQPquhGRfrBQS6lCnhAWEX6JAlRet4lehIpQjiCAn0 HXLpBR/f5m88ryMExk6iT8Wc4TKU+99cPEEGi5iZiJD41GceuuM= =/mwk -----END PGP SIGNATURE----- --G3juXO9GfR42w+sw--