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 1oYrbU-0004b1-3F for pgsql-bugs@arkaria.postgresql.org; Thu, 15 Sep 2022 16:20:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oYrbS-0000CX-T5 for pgsql-bugs@arkaria.postgresql.org; Thu, 15 Sep 2022 16:20:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYrbS-0000CH-Gz for pgsql-bugs@lists.postgresql.org; Thu, 15 Sep 2022 16:20:38 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYrbQ-0003Aw-5v for pgsql-bugs@postgresql.org; Thu, 15 Sep 2022 16:20:37 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id C9E0F3200A72; Thu, 15 Sep 2022 12:20:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 15 Sep 2022 12:20:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1663258834; x=1663345234; bh=c ZCfEqbFyDaVw9yvCWufQek8+Gt+c++MODkMC3jjFj8=; b=tmgjGXyidSGCiewX7 8jHL/zsCikRPY1L2wkhOF7Lh+u4XbzXT9iq4qxoD2sYxRSE0hwudyABy4wQ/KYUE ikYSh5vLLkoV5q9JejD4Caq9UOyU2EPY9yfY4Mq2m8WhYrx5mSW8w57IvQxJ//JQ YBSygdZyoMeCJ33BKgtCEORVxLsxu1kTjYnQ7hKC4/wzIurK7D/0PZHLwq2VxoVg nu9NoR7SPPeIfRT7/7l5AB0dEFfpVd83uRlVqzCV/EV8szYN6cdv14iRSEeAIaAT iSCF9Pu5zUgc5iEIaSDUelRhJZv2579FpkYiQ/Cw1UZYD6dSN82NI5iJsa+q3g9g itYSA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedukedguddtudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhv rghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeej keffgfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtoh hmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghl vhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 15 Sep 2022 12:20:33 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id D07DA35F; Thu, 15 Sep 2022 18:20:23 +0200 (CEST) Date: Thu, 15 Sep 2022 18:20:23 +0200 From: Alvaro Herrera To: Daniele Varrazzo Cc: pgsql-bugs Subject: Re: Regression in pipeline mode in libpq 14.5 Message-ID: <20220915162023.6psky22qdhi5xvwf@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Aug-14, Daniele Varrazzo wrote: > I believe that pipeline mode was broken in libpq 14.5, likely after > the refactoring performed to solve the problem of the unexpected Close > messages sent on PQexecQuery [1]. So I've spent a lot of time trying to understand what is going on here, and my impression is that this stuff is thoroughly broken, and I don't know how to fix it. So I propose to rip it out -- specifically: make it an error to call PQsendQuery when in pipeline mode. PQsendQueryParams can be used instead, and all is well. The problem is that that the CloseComplete message remains a mess, and the hack I added made things worse, or maybe it just moved the mess elsewhere. More specifically, I propose to remove its handling from 15 and master; but leave it in place in 14, to avoid breaking things in a minor release if somebody is already using it and they haven't run into this particular bug. This should be OK for psycopg, since Daniele said he already stopped using PQsendQuery in pipeline mode. PS: it's quite likely that there *is* a way to fix it, if we're OK with more coupling between fe-exec (PQgetResult) and fe-protocol3 (parseInput3). But we probably don't want that and I don't want to spend more time figuring out exactly how. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/