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 1gHd76-0002ur-4W for pgsql-bugs@arkaria.postgresql.org; Tue, 30 Oct 2018 23:07:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHd74-0003H1-1w for pgsql-bugs@arkaria.postgresql.org; Tue, 30 Oct 2018 23:07:54 +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 1gHd72-0003Gu-W5 for pgsql-bugs@lists.postgresql.org; Tue, 30 Oct 2018 23:07:53 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHd6v-0004Zt-D5 for pgsql-bugs@lists.postgresql.org; Tue, 30 Oct 2018 23:07:51 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4949B2208A; Tue, 30 Oct 2018 19:07:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 30 Oct 2018 19:07:44 -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=9nAfKuSNQ4ZOoTZe5Y9WHbj2GHM Gs1LxVpkCoPNXZr0=; b=mwrhN2udtqzJvlsJqRxoOei+QN/gjJPZNPqod5VPnH6 letQEwlxXI3IKLiB7k5959tRBIMbcefy/dpeGkOzivWQ+Mh65LIxTAGIpcbBW7OX j5HsSE76wdyw0FvvtXIWP8AIJXqhQiNnwuuRDv1esDYUBL2xXzGMf7C2q0wyHIjf BwYw7vQgrBW/KysPhrc5nCFEth9rbfIQWX8w/kGcyDO3J65Gh5BSaJECHAiFdYDQ oPIHdJN8hXCrqz00LLtohibkfGs3ehbVFpmYDVKLmx80kP2ZJiVU/I2bOF5b4Zsf 7FOuqCToevdBnpmUhT0lBTpXkRqM0utOPhxaI0u4FVA== 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=9nAfKu SNQ4ZOoTZe5Y9WHbj2GHMGs1LxVpkCoPNXZr0=; b=H84qO1fnyQ8Sxiz8EStbpU WwOEZfGKr1qyL57/e2pygxrDqUboIqrpjjJKBPx6V/FCAzFPQPb1KF/1BooG/yDj STP5EmMFE874RbvfakgeJJ3983600+olrsCq/7U2Urf7nWmLFM5k+R/pvKhNxYHr MbBW4j90d41VdJPIyBfieyIGqJIGyGb5i+xkSLJgJGIrQtdTY0V8KGk8cIPBhbf0 fRkJ4s3IAbBnJ5yPeAnDmPTlfBoTmuFU0JYPTIZxkoE6vpsq3AG5gJrsR+o6NXNI UC+NVlN3jZgv+v/xbDTfzXinx8DNlACG2vu65pwFGcOL5igZfVDY5ko/SbFaJzKA == 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 044AE1030A; Tue, 30 Oct 2018 19:07:39 -0400 (EDT) Date: Wed, 31 Oct 2018 08:07:36 +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: <20181030230736.GA1632@paquier.xyz> References: <20180326160801.ja4j43hwrc35iuhb@alvherre.pgsql> <20180416175901.mdevawuuhvwo3yk6@alvherre.pgsql> <20180427012203.GG3419@paquier.xyz> <11af0d1b-e48f-fba3-5b1e-49886f648f52@2ndquadrant.com> <20181029015438.GC14242@paquier.xyz> <4cc78025-2bdd-082d-fe38-a35366ba8867@2ndquadrant.com> <20181030062828.GB23393@paquier.xyz> <19dfa54d-6c4a-744a-d78a-4845b8da8241@2ndquadrant.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="J/dobhs11T7y2rNN" Content-Disposition: inline In-Reply-To: <19dfa54d-6c4a-744a-d78a-4845b8da8241@2ndquadrant.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --J/dobhs11T7y2rNN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 30, 2018 at 08:45:57AM +0100, Petr Jelinek wrote: > The receiver side *should* actually use RelationGetIndexAttrBitmap, the > problem there seems to be rather than we setup snapshot few lines of > code too late in worker.c. Does the worker need this much information though? It just needs to know about the replication index itself and its columns, not about all the other indexes. It may make sense to unify both code paths to behave similarly. >> both sides. In the patch, something which makes me uncomfortable is >> that get_rel_idattr() is a duplicate of the code paths taken by >> RelationGetIndexAttrBitmap() when INDEX_ATTR_BITMAP_IDENTITY_KEY gets >> used to fill in the relation cache. In this case, wouldn't we want to >> just fetch the replica index instead of the full index list? >=20 > I don't follow, we *do* only fetch replica index in the new function. I am wondering if both things should be unified, or simply if we should just remove completely the dependency on the cached Relation in get_rel_idattr(). One function able to overwrite what the other does is weird. > If we want to put additional Asserts it should be about having snapshot > not about output plugin IMHO. That looks like a good idea to me in any case, and that's a good thing for HEAD. Something like Assert(ActiveSnapshotSet()) perhaps? I have not thought much about it to be honest. Let's tackle that with a HEAD-only, separate patch. -- Michael --J/dobhs11T7y2rNN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlvY5DgACgkQnvQgOdby QH1ufxAAkQjakypxWSeOW2yJ98Aj9Yx3Ud+g9AwTK/gpR737uoyJM09ma4qDbQvU mRvUA1sS0IIMHzT+cqnmMsFGMcvIdnghejLdegmSvaZ6bbRssSMFEdPv7WvKmiDA G3ijMh3zssXrNOQknY41AHqX3uK7PHIyA0HoxcOX2LNbp7W4T6453sgBepZBYMBR Gl78ou0vo1q96fk6u/YLQPifGlB0cN9cB5xkr11z9tbG7xU9XuXG5U1TWv3ZmY8i J5yImJZrK8wrfQUUwrH7cTNO4Z8mh3isxPnfzX7mZkvPlFbyRH2ZBix3HT6oD59N /8EmzG6+G8RhTTMCMCp5SqanvV6Ao8p/IVSpf9pnevJnIP0cMI/egKI56XKNXaTO 9bUtw5V2A8Wq59GOrBPikU/8MTp5qnTE3Q1EgCswjdKC16mIOgww1TOFw5e88vjs rD2rpInbr8A3Bwwid1EUsi3o2ktIqZG7P7II3YSAmQ9isEPcsR9zXw9S1Bvrvk8q A7Mw1FdmPPgHtHaOeTiH/AWSbvbIPa7kxUFi+oV7aAniuCHRsAK2J5CHGTA5O3v0 W/oafuZzF3+4mhSubm73LAkcy7DGO+Rg1MLBnlEWEPw0PkULptc1Ao02sO6BW1Ub NHc0NMMZgmI412RSYuLRXzkMZqlmsNLYx5+kog9rb08oYnhB22c= =W9Po -----END PGP SIGNATURE----- --J/dobhs11T7y2rNN--