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 1sqaXX-00AzD8-RB for pgsql-general@arkaria.postgresql.org; Tue, 17 Sep 2024 15:54:56 +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 1sqaXX-00Cwuh-HD for pgsql-general@arkaria.postgresql.org; Tue, 17 Sep 2024 15:54:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sqaXX-00CwsC-5v for pgsql-general@lists.postgresql.org; Tue, 17 Sep 2024 15:54:55 +0000 Received: from fhigh3-smtp.messagingengine.com ([103.168.172.154]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sqaXT-001fpG-0W for pgsql-general@lists.postgresql.org; Tue, 17 Sep 2024 15:54:54 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 9A2C01140183; Tue, 17 Sep 2024 11:54:50 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Tue, 17 Sep 2024 11:54:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1726588490; x=1726674890; bh=3zHMSX2XBjuPKBjSwmEqUQ/sK/VdmP/7PxwIV2qvnL8=; b= ngCN2BxJNbwhdT9NbhS//c9RMF2/t7TfGxSG8KoSF40fqgbvvZrs3zwY2j7zRCd3 6sOVPZVTs8QhpVCPqxqlzXYZM9wlsAAqwcI0uu2HIjIOd65KXIE1IfFLYqlLZhxG Kq173WQCipx9pExpnANyXt8+jcCy/JSil7m7Fodo8G4jeMIOl3yiqSOgDmZn7TwG epU3vPX5CxRptVUz84ww+HyP8p1XreZ8M+W//0miu5NSXIr6o2Bb1s1r/duSkYCY aNd5KBm04pjkF8siFtIRoSCOx7+qLDEMymT+fRNUqPh9RlbdLhT/quGPBuTucklO DQjaBokaz0dR2fKMsjaCGg== 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 :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1726588490; x= 1726674890; bh=3zHMSX2XBjuPKBjSwmEqUQ/sK/VdmP/7PxwIV2qvnL8=; b=s RT8ulL/x6PxbZYkxpM3qo/52nVqpqFNj79tf1VvmTMtLaAEq26fdMKNApU2KVbPx lOFJSxuyC6wk+P2cNSVOYH/MkXzQkIpD3LMdaraakJJtjap6bm6f0pwogJ9fY+f0 ianmfRmCiPD+QsoqAq7E0vqz9xKNVWsk/dtXzN7EZrR8dsTOaPaPb1M8Jkn4hgKf kfwlZKNQDd/Ie1Ady7uAm/9NLigAthNjq4saaSPC+Z7q5/QeYLz9VZ7lXc+nkPFT ym1HzmSc6PbxMAtIVOvWUN91TsmIeDYGV2M0dAXdyap2e8qtnzXmPunO+9gEHxWg yMcAsPI7lX05W2xPKh4qw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudekjedgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdej necuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrh esrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepvddttddvgeefhefhueet heegffevffelvedujedtueetgeevhefgvedtleehhefgnecuffhomhgrihhnpegrphgrtg hhvgdrohhrghdpphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklh grvhgvrhdrtghomhdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhr tghpthhtohepvhgvvghmrgdttddttdesghhmrghilhdrtghomhdprhgtphhtthhopeigoh hfsehthhgvsghuihhlugdrtghomhdprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghl sehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 17 Sep 2024 11:54:49 -0400 (EDT) Message-ID: <225d1bc1-5117-4c72-85a1-bac6355fb659@aklaver.com> Date: Tue, 17 Sep 2024 08:54:49 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: IO related waits To: veem v , Christophe Pettus Cc: pgsql-general References: <3dddea5e-52ab-4075-970d-a87b0c921ae7@aklaver.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/16/24 20:55, veem v wrote: > > > On Tue, 17 Sept 2024 at 03:41, Adrian Klaver > wrote: > > > Are you referring to this?: > > https://nightlies.apache.org/flink/flink-docs-release-1.20/docs/dev/datastream/operators/asyncio/ > > If not then you will need to be more specific. > > > Yes, I was referring to this one. So what can be the caveats in this > approach, considering transactions meant to be ACID compliant as > financial transactions.Additionally I was not aware of the parameter > "synchronous_commit" in DB side which will mimic the synchronous commit. > > Would both of these mimic the same asynchronous behaviour and achieves > the same, which means the client data load throughput will increase > because the DB will not wait for those data to be written to the WAL and > give a confirmation back to the client and also the client will not wait > for the DB to give a confirmation back on the data to be persisted in > the DB or not?. Also, as in the backend the flushing of the WAL to the > disk has to happen anyway(just that it will be delayed now), so can this > method cause contention in the database storage side if the speed in > which the data gets ingested from the client is not getting written to > the disk , and if it can someway impact the data consistency for the > read queries? This is not something that I am that familiar with. I suspect though this is more complicated then you think. From the link above: " Prerequisites # As illustrated in the section above, implementing proper asynchronous I/O to a database (or key/value store) requires a client to that database that supports asynchronous requests. Many popular databases offer such a client. In the absence of such a client, one can try and turn a synchronous client into a limited concurrent client by creating multiple clients and handling the synchronous calls with a thread pool. However, this approach is usually less efficient than a proper asynchronous client. " Which means you need to on Flink end: 1) Use Flink async I/O . 2) Find a client that supports async or fake it by using multiple synchronous clients. On Postgres end there is this: https://www.postgresql.org/docs/current/wal-async-commit.html That will return a success signal to the client quicker if synchronous_commit is set to off. Though the point of the Flink async I/O is not to wait for the response before moving on, so I am not sure how much synchronous_commit = off would help. -- Adrian Klaver adrian.klaver@aklaver.com