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 1lbXeI-0000Lb-UA for pgsql-committers@arkaria.postgresql.org; Wed, 28 Apr 2021 00:01:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lbXeG-00024U-J0 for pgsql-committers@arkaria.postgresql.org; Wed, 28 Apr 2021 00:01:48 +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 1lbXeG-00024N-Dp for pgsql-committers@lists.postgresql.org; Wed, 28 Apr 2021 00:01:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lbXe8-0006CV-I2; Wed, 28 Apr 2021 00:01:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 13S01cMm2752963; Tue, 27 Apr 2021 20:01:38 -0400 From: Tom Lane To: Amit Kapila cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Implement streaming mode in ReorderBuffer. In-reply-to: References: Comments: In-reply-to Amit Kapila message dated "Sat, 08 Aug 2020 02:29:17 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2752961.1619568098.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 27 Apr 2021 20:01:38 -0400 Message-ID: <2752962.1619568098@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Amit Kapila writes: > Implement streaming mode in ReorderBuffer. I notice that new buildfarm member wrasse is unhappy about some of the code added by this commit: "/export/home/nm/farm/studio64v12_6/HEAD/pgsql.build/../pgsql/src/backend/= replication/logical/reorderbuffer.c", line 2510: Warning: Likely null poin= ter dereference (*(curtxn+272)): ReorderBufferProcessTXN It's griping about this: curtxn->concurrent_abort =3D true; and I think it's got a point. There is little if any reason to have confidence that curtxn must be non-NULL when this code is reached, because it's in a PG_CATCH segment and there is a lot of code within the PG_TRY that could throw an error before the spot where curtxn is set. Not to mention that curtxn is set only conditionally. So I think if (curtxn) curtxn->concurrent_abort =3D true; would be cheap insurance against a core dump. Or maybe we should do something else, but this seems really rickety as-is. (wrasse seems to be generating boatloads of utterly useless warnings otherwise, but after sifting through the chaff I did find this one.) regards, tom lane