Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gGwlb-0004dk-P5 for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Oct 2018 01:54:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gGwlZ-0007E9-Gi for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Oct 2018 01:54:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gGwlX-0007E2-QN for pgsql-bugs@lists.postgresql.org; Mon, 29 Oct 2018 01:54:53 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gGwlT-0003Rz-Kz for pgsql-bugs@lists.postgresql.org; Mon, 29 Oct 2018 01:54:50 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 8C1C2E77; Sun, 28 Oct 2018 21:54:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 28 Oct 2018 21:54:46 -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=fm3; bh=Y+rxRQejimfajmWa7QWmLJhKLhR HGZxrpUQTtCy4S1Y=; b=dBPdoSMyZ+y9uynYWpTAKHS3XDzRck6wjU48DZJAMQs 4RCS6LleQPwkt+bPrxqPKxk0QNGdsGa/xZZiZ8ISFiPoe79h+tHyQaBpsDAobJTV m/95bjMoAdHnHQOZxV1v2HoY5MqAuzgfG2DrzZBhIyYi5dU0JyJYx7dl5cRKmj99 PzFHEZNEJjax/rPVw86WYrDKEabqYMe1XPCCmA8fsTbXOOxmH7JJ8USXWgKnh13h eqUMNyNDskdv8mdbwyEX0Ks2NLYLdFryw9o6UWhbHZf3XB2EBnpz7A+u1wmcRyiW 8Wp1GdQFKp6Vw8rx//eRI9T5VEskG9mYOMSATFAk1ZQ== 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=fm1; bh=Y+rxRQ ejimfajmWa7QWmLJhKLhRHGZxrpUQTtCy4S1Y=; b=dPG832GClv7DIydKtThgbq sLftMpJba+e2Ug2JA2tm3L8v5016DSgs+D4Q34HLSGRTboEpX26ys0pP7IsdsDmb nwFuHc/wF3vMEXMhGtDTFbKKT2ZYz4ITR5ZOzu7BbRz9iR6DsaNLu90tFtLFFHAU nv/E8Ny2gTb81wo4A8WzIbs5i9Y2JRzViwYfcBu6dMkmp0Y6sznOSbsKJ74bVhwT 3qCumG/t6Lo6h3LZ1jiu8X8Xod1fM6BMeUnru8CLJoNwFO0OxVsyAKj7efhWrM0z jGU+nx24LA9WSalg/1/2pJfnHbiUFqTGe1qxszMrhHLIg7m+UoQfXstoE8eHy5bw == X-ME-Sender: X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id EC659E4412; Sun, 28 Oct 2018 21:54:41 -0400 (EDT) Date: Mon, 29 Oct 2018 10:54:38 +0900 From: Michael Paquier To: Petr Jelinek Cc: =?utf-8?B?0J/QtdGC0YrRgCDQodC70LDQstC+0LI=?= , Alvaro Herrera , Andres Freund , Petr Jelinek , pgsql-bugs@lists.postgresql.org, Peter Eisentraut Subject: Re: BUG #15114: logical decoding Segmentation fault Message-ID: <20181029015438.GC14242@paquier.xyz> References: <20180326160801.ja4j43hwrc35iuhb@alvherre.pgsql> <20180416175901.mdevawuuhvwo3yk6@alvherre.pgsql> <20180427012203.GG3419@paquier.xyz> <11af0d1b-e48f-fba3-5b1e-49886f648f52@2ndquadrant.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Pk6IbRAofICFmK5e" Content-Disposition: inline In-Reply-To: <11af0d1b-e48f-fba3-5b1e-49886f648f52@2ndquadrant.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Pk6IbRAofICFmK5e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 28, 2018 at 11:59:49PM +0100, Petr Jelinek wrote: > I wrote my own patch to solve this which is quite similar to Alvaro's > except that it does not do the manual work to build indexes list as we > already have RelationGetReplicaIndex which does all the necessary work > and also uses the same rd_idattr for cache that > RelationGetIndexAttrBitmap does, it's better for performance and looks > safe to me. >=20 > I attached both patch for PG11+ (ie master) and the backport patch for > PG10, they only differ in the line identified above as problematic. Hmm. I am studying this patch, and this visibly cannot be easily reproduced? I would have imagined that something like this would be enough, with a predicate index on the publisher side which is in charge of loading the : -- connect to publisher \c postgres postgres /tmp 5432 create table aa (a int not null, b int); create function copy_int(a int) returns int as $$ select $1 $$ language sql immutable; create index aai on aa (b) where copy_int(b) > 0; create unique index aai2 on aa (a); alter table aa replica identity using index aai2; create publication big_tables for table aa; insert into aa values (generate_series(1,100), 1); -- connect to subscriber \c postgres postgres /tmp 5433 create table aa (a int not null, b int); create function copy_int(a int) returns int as $$ select $1 $$ language sql immutable; create index aai on aa (b) where copy_int(b) > 0; create unique index aai2 on aa (a); alter table aa replica identity using index aai2; create subscription sub_name CONNECTION 'host=3D/tmp dbname=3Dpostgres user=3Dpostgres' PUBLICATION big_tables; Is there something I am missing? If possible, could it be possible to add a test case in 001_rep_changes.pl with a more complete schema?=20 -- Michael --Pk6IbRAofICFmK5e Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlvWaF4ACgkQnvQgOdby QH3LGQ//aifuRTIhxwf20/tzc2Y/3liG3XDlIPbh93vphRatwBrMtL2kfrUABq2c lHU+Tq+oA9yaTwbYlnRXMPDlFUHPl102CQsqtN6WijXXlbO7UjETt80nZFzrlWsC 2Jq3a8HlVmEbY4lzyrx9AWHRSjwghRUG0B5ex6gq7tP2BV58ToCaFQ20/eMBCE9R VsAmbLlj2wJ7DJTlhNLMTH6YGM0UX29e97SjrpQy1USbMDJu2gkNjffdaqEoj2JV d0kAJ51gjn4tgFGLChXtlNRe7eEKe4+Oes1aiRrdd9GKpzOumTYhUn3y6hb3+HnI CHn5SX3oa3gyfbnGDbngt7jieJwE1COsxCUFWd8U2MC0ZUSFZVbwtFF3pY/7Cr2O ytXpuYuqIQsBVVbc3Ax7i6bGYQE9IxUwCCjH1k6LQn3OBkyDgkkJFo7cDP8qoGTT QluKezXG2rWtktWszVnoHph0DKmd5SCyTzVH3v1d/sGlfC9jVQvdtTpS2vWjS2IO UjlSPDhvt4Deau4PDEKIpsJ9221UFrSMOMjSckBTx4P1CzJGnIM3vfsRqvd7FJkd WHtbuUF4KTHRNzHkM9FD6WV7XxcV9ohCa3htKjySjTYMgFiNnPZphju5xY488MfC J6xVaa38NYljvphoXeVDMbn2jLVauvUjJGM+pmGUz8F4EQuFqYo= =3n00 -----END PGP SIGNATURE----- --Pk6IbRAofICFmK5e--