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 1lHd98-00073v-II for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Mar 2021 01:51:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lHd97-0005ge-FI for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Mar 2021 01:51:21 +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 1lHd96-0005gX-MI for pgsql-hackers@lists.postgresql.org; Thu, 04 Mar 2021 01:51:21 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHd90-00073Q-Bc for pgsql-hackers@lists.postgresql.org; Thu, 04 Mar 2021 01:51:19 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 50C6E1792; Wed, 3 Mar 2021 20:51:12 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 03 Mar 2021 20:51:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Ec2lwrnOGz5K/Uh/MWQW6DQLhzxB4zg7hBfZkCI1Gjw=; b=am2njgSo Qv0CjhyT40YJAPpj0pBTgrblU2cIpKkdyCXPBDSpCGHKo77yx3a1HHcKBoC2Ep4J MJnUgOlaLy+KqIdIpNNB78AbFz70DqcxbTk1dWolUeN76DBUbe4xAG2zhKkkn83e U2y+Jfypz54lJdZCMEQPdFim71Sq0e8w+YUgZg9ABd9PpI61qr2Pjvl+iWp0a60l EYxqFcGlT+i7LVrFs0ovfqcnpi5obWXyQVGWzTOGFWBsvm0g8NXuWKl3OSJWMNms QFqUcKVYg8ajI6cU+iuTpHC7HsKbTfY0+DgqiYK5fE6pX/scqSmS3amLUkjA+Z+9 nC6JRCHJdvZMPw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddtfedgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjfgesthekredttderudenucfhrhhomhepkdetlhhv rghrohcujfgvrhhrvghrrgdkuceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdroh hrgheqnecuggftrfgrthhtvghrnhepgfdvvedvteeiheevgfeltdetgffghfeghedvleeh vdetiedthffgjeegkeekjeeknecukfhppeduledtrdelhedrudelrdelheenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvges rghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id DAAD21080066; Wed, 3 Mar 2021 20:51:10 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 0A4452A14F6; Wed, 3 Mar 2021 22:51:08 -0300 (-03) Date: Wed, 3 Mar 2021 22:51:08 -0300 From: 'Alvaro Herrera' To: "k.jamison@fujitsu.com" Cc: Craig Ringer , Matthieu Garrigues , PostgreSQL-development Subject: Re: PATCH: Batch/pipelining support for libpq Message-ID: <20210304015108.GA15670@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210304002429.GA8225@alvherre.pgsql> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Mar-03, 'Alvaro Herrera' wrote: > On 2021-Mar-03, 'Alvaro Herrera' wrote: > > > This should obviously not occur. I'm trying to figure out how to repair > > it and not break everything again ... > > I think trying to set up the connection state so that the next query > appears in conn->last_query prior to PQgetResult being called again > leads to worse breakage. The simplest fix seems to make fe-protocol3.c > aware that in this case, the query is in conn->cmd_queue_head instead, > as in the attached patch. I wonder if it would make sense to get rid of conn->last_query completely and just rely always on conn->cmd_queue_head, where the normal (non-pipeline) would use the first entry of the command queue. That might end up being simpler than pipeline mode "pretending" to take over ->last_query. -- Álvaro Herrera 39°49'30"S 73°17'W "La verdad no siempre es bonita, pero el hambre de ella sí"