Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r6MG7-000cYW-9b for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Nov 2023 02:49:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r6MG5-006uvb-Io for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Nov 2023 02:49:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r6MG5-006uvS-98 for pgsql-bugs@lists.postgresql.org; Fri, 24 Nov 2023 02:49:33 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r6MFy-0074Uk-I5 for pgsql-bugs@lists.postgresql.org; Fri, 24 Nov 2023 02:49:32 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id E82A55C0164; Thu, 23 Nov 2023 21:49:25 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 23 Nov 2023 21:49:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1700794165; x=1700880565; bh=t3 MTN/3LPMxkhscagpjmLlJ5xkS9KXV+ah7hyCixne0=; b=Ky0ml0mkXly2khODMv aUl1HU1FyAo+NeB2sL3FfLOHR9aUojyT/NSO14qQePRaxw/p+KIw/pK/89KU/xPV VcEMi2NNdjSoAg/99V4/C6F5CECK/mAaNuag8cYD/fhReX/WhleeUaQma9iN5k8E 7wmjVeJwyaPADNt5UqRbcDmPGyT+G2zOx7sfp+6rsjJtJ16ibSvPU9WJte+FbUnn iPl7UEpb540rp6NJoGA/s9/gVFy+3EKFOEajvYClIXgEyxsWnVVH/qiaakCfQ2N/ kA2tSYxqdxpnokm2SNt6zSp08wHfVdMBraVO2EWwdJ9gq5Tr0L6P7mX39LGDNI1T mQJw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1700794165; x=1700880565; bh=t3MTN/3LPMxkh scagpjmLlJ5xkS9KXV+ah7hyCixne0=; b=yGQUhGrQSpH3xTWrNph6y2zNCWucL oBd6AlrXg7tbshCyQr5fomdxyWRk3AkFiaZQup+L3Sz9g2VOaC3err04Q67fWVXa dCfZwGl+K+YPTBCDOyy3FIR19LbdINd+ueVFMO+qHEQprUrvhRRLrFbrwnCqv4X1 eb7HxQW594sOXTL+zd3ZuxNzrSTkw+/tUmLObvWhqxR5l5S5Sfq+maivwEVfok7D zTA8kbXZVD29vyyeTjHXV6QEBh0X4vj3g2YN7jeRc9/06r0rMiZSLYqrCkj0oYhB 7lhP4JZ5X/8Zj5/MpItY+KsiD5KJvuF1x+3vFhwdK26w53f7jSzGXISjQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudehgedghedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdlvdefmdenucfjughrpeffhf fvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghq uhhivghruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvg hrnhepgeekkeetgedthfejfedvffevgefgueduffeiueeifffhueeujeeiieeludevhedt necuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghdpghhithhhuhgsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghh rggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 23 Nov 2023 21:49:24 -0500 (EST) Date: Fri, 24 Nov 2023 11:49:21 +0900 From: Michael Paquier To: Ivan Trofimov Cc: pgsql-bugs@lists.postgresql.org Subject: Re: libpq: pipeline mode might desynchronize client and server Message-ID: References: <1efe6f16-30f1-8dd2-7d5a-a6acc4203cc1@yandex.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eIp4LAPTWslV2Jap" Content-Disposition: inline In-Reply-To: <1efe6f16-30f1-8dd2-7d5a-a6acc4203cc1@yandex.ru> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --eIp4LAPTWslV2Jap Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 22, 2023 at 03:13:46AM +0300, Ivan Trofimov wrote: > This is a follow up on > https://www.postgresql.org/message-id/17948-fcace7557e449957@postgresql.o= rg. Is this the same bug as discussed on this other thread? Why is there a need for a second thread? > Libpq in pipeline mode considers '< 2TDCEZ' a sufficient response to > '> BDESS', when according to specification one more 'Z' is expected. > This leads to client <-> server desynchronization, when libpq parses the > very next message server sends (which is Z, as expected). >=20 > A bit more context and a MRE: > https://github.com/itrofimow/libpq_protocol_desync >=20 > I'm pretty sure that this branch https://github.com/postgres/postgres/blo= b/3af101ce8be8eeb0e8adc61e293b5d12989f68be/src/interfaces/libpq/fe-exec.c#L= 2124 > should be adjusted to handle the case and do not match error response > against sync query. Could you attach the test case to the original thread please (assuming that this is the same problem)? If this data is deleted by github, then any data making a problem reproducible would be lost. -- Michael --eIp4LAPTWslV2Jap Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmVgDzEACgkQnvQgOdby QH0XlQ/8CgHmtfqH3V0hFN5eZuIlXI7bVrMPn0FT06VHxU7HjS4b1Q91Ij7AF4vs trbp/8TM4KudhbKSzWWAdpu+Rnnwyw8+O2TTIlG4vyKsyq+o0Uqm05DxQMxg+PBA sioC5hfkl0t8Wokithl+qn2py+0tlzlSwN4fMRDM4aMv+0dmOjkVOH52DEHLkwWk jCYDsqENRefbG85tdO+0JJx4Ow054tEc1ShXHZ58kgjJcL/FyDRwmj/vziqK+L6j z0vDpUoTsc6jeMmxk7YaGUcvT0TVCtBDd+BIjasu3wAytls6Fay4ChyB0J5rXGcN PCRafVdY5MMO8aODFdX3L1w/bvHTITwYico1U+IyFNAI1lZnQAIYaTiHcYWze4yi EWVQqmFvmtLHmOMe+kHg0qtbrlvbdZWWnmmTKnwOdmjfnx6FrUsv/YvTAOenN2XE fJivCmEZIaU7b5exBU6t/Spnu5kHBMtupE+IwiGhmNLLsCJo+4OaMfXnF9vMDHT2 o/2mG+jxLe8ugkC7IUwy86y//85GQx007z1X1wnWZspGxQPJD3Kat8wuy1oCxMoO phT1eYHddXWnrhribkdVw2+WCeL6GaZ4IZHKZb99ba3SyOu6F78+wyQBC3jZIps3 Z2xfrR9VdE7lK1TZ7UphYBVskCtON4FxWmcGIkzajKATdFFHdkI= =yiz+ -----END PGP SIGNATURE----- --eIp4LAPTWslV2Jap--