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 1puWKS-00062H-Kh for pgsql-hackers@arkaria.postgresql.org; Thu, 04 May 2023 10:36:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1puWKQ-0006lI-IT for pgsql-hackers@arkaria.postgresql.org; Thu, 04 May 2023 10:36:50 +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 1puWKQ-0006l7-9n for pgsql-hackers@lists.postgresql.org; Thu, 04 May 2023 10:36:50 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1puWKN-000T7S-9S for pgsql-hackers@postgresql.org; Thu, 04 May 2023 10:36:48 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E92235C0080; Thu, 4 May 2023 06:36:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 04 May 2023 06:36:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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=fm3; t=1683196605; x= 1683283005; bh=GzadCkjVz+HY2Wy2RWt8yKRkuaU7rgHsFao8nlpNwoE=; b=Q /DUJcdhgpBBuimPbLZADj+2FXlgG0gUxMkp3IfvH/0XD7/BjBast5oOfgmiI+P/p 4lWNM57PYxfWE86/kF6TecOmKgudlmxP+mgfT63rB28QtXjfMkK43YHsrG0QIx0w 1f3S+jP9hVmuekvKDNpB4NOJ8grK02Z3MmOaiTkrug0oERMq8IKMmM1vgzlEVZpX tAZ/1rgF0Rvhsg/T18eqZ0QqSvnRwhvagc/AQ6BeJD+KcxuwZ+ioKhEqjfvsOXdv ggUStdXOu2y0zw4Fa4CtbjrBxX/hikHGCsU9e8S85sWm6i5Mkw6Ewk+jbc/UVoNd NOeDme5tCxPTDvksmIWrA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeftddgvdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 May 2023 06:36:45 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id D0ED4A0; Thu, 4 May 2023 12:36:42 +0200 (CEST) Date: Thu, 4 May 2023 12:36:42 +0200 From: Alvaro Herrera To: Anton Kirilov Cc: Michael Paquier , Robert Haas , pgsql-hackers@postgresql.org Subject: Re: Add PQsendSyncMessage() to libpq Message-ID: <20230504103642.sip34d7kszi6b4cd@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 2023-May-04, Anton Kirilov wrote: > Thank you all for the feedback! Do you have any thoughts on the other > issue with PQpipelineSync() I have mentioned in my previous message? Eh, I hadn't seen that one. > Am I just misunderstanding what the code comment means and how the API > is supposed to be used by any chance? I think you have it right: it is possible that the buffer has not been fully flushed by the time PQpipelineSync returns. If you want to make sure it's fully flushed, your only option is to have the call block. That would make it no longer non-blocking, so it has to be explicitly requested behavior. I think this means to add yet another behavior flag for the new function: have it block, waiting for the buffer to be flushed. So your application can put several sync points in the queue, with no flushing (and of course no blocking), and have it flush+block only on the "last" one. Of course, for other users, you want the current behavior: have it flush opportunistically but not block. So you can't make it a single flag. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/