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.96) (envelope-from ) id 1wrFFv-000EVU-0v for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Aug 2026 13:32:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wrFFr-006aE3-1i for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Aug 2026 13:32:27 +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.96) (envelope-from ) id 1wrFFr-006aDp-0C for pgsql-hackers@lists.postgresql.org; Tue, 04 Aug 2026 13:32:27 +0000 Received: from mail.postgrespro.ru ([93.174.132.70]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wrFFo-00000000CRR-0aNX for pgsql-hackers@postgresql.org; Tue, 04 Aug 2026 13:32:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1785850342; bh=2sTBko81tJhJS/cvX2pNjFDv8Vxq9yZB5Y4pLJ884+Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID:From; b=jWmGp8V3wk5LRZYEsjbEg92MgUTzC1y8LjHq4i7UW3tEtZ84iPuz3wObKzDiIYiPZ SjCrY9SH//JvJWieWupVqEbIT+DZSD2KsvSBN8iQCQhK/SIVt695pNM6LPUG7GDB/H ezs541oOqLIeWcOIXJlCPN7LCOdIRQqWpWAmAZ5+MpG1vA6VhCIf9XPMZzgD9HvQhU GhFLBw1pLgr9L+hz/6TVH6eOGJLZafIofPO1VvQvh+/YoPNx/CFaJWbp3Xg7+e+RE5 Ng3Fymip18AXTa5DVIeXaUw1Qr1DNInay+cGUMfkcXDdGMm+eMmL+fBdO/OvlMWKLR XRTQ1vq4EbhzQ== Received: from mail.l.postgrespro.ru (webmail-master-mstn.l.postgrespro.ru [192.168.2.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: a.pyhalov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id 7CA8961645; Tue, 04 Aug 2026 16:32:22 +0300 (MSK) MIME-Version: 1.0 Date: Tue, 04 Aug 2026 16:32:22 +0300 From: Alexander Pyhalov To: Etsuro Fujita Cc: Alexander Korotkov , Matheus Alcantara , Pgsql Hackers Subject: Re: Asynchronous MergeAppend In-Reply-To: References: <59be194c5a409fb9fc9f2031581b8a44@postgrespro.ru> <2fb1d9923b6995492e7b163e6cb95402@postgrespro.ru> <782a968c8e01ec6db3b2da2120adf73b@postgrespro.ru> <554a73f7ffea8b22b3f81a4804b5fc34@postgrespro.ru> <42a9a941-e768-4fd8-8067-12958c5a1d70@gmail.com> <10c97af0ce34ebdb81708b1c49ed6038@postgrespro.ru> Message-ID: X-Sender: a.pyhalov@postgrespro.ru Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-KSMG-AntiPhishing: NotDetected X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 3.0.0.9059, bases: 2026/08/04 09:28:00 #28645557 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Etsuro Fujita писал(а) 2026-08-03 17:13: > On Mon, Aug 3, 2026 at 3:41 PM Alexander Pyhalov > wrote: >> Alexander Korotkov писал(а) 2026-08-01 00:03: >> > On Mon, Jul 6, 2026 at 4:42 PM Alexander Pyhalov >> > wrote: >> >> Alexander Korotkov писал(а) 2026-07-04 02:05: >> >> >> >> > While discovering a correctness of callback_pending flag reset in >> >> > async MergeAppend, I found bug in async plain Append [1]. I've >> >> > included the fix as 0001 in the current patchset. >> >> >> >> I expect that this issue can affect both MergeAppend and Append, but >> >> current test cases don't confirm this. >> >> If we revert to the old behavior (setting areq->callback_pending to >> >> false), the tests results of Merge Append tests >> >> are not changed. >> > >> > Did you try the test case showed by Gleb [1]. Yet I think it's safe >> > to follow the fix by Etsuro. In the revised patchset I put this into >> > ExecAppendBaseAsyncProcessPending() and use for both async append and >> > async merge append. >> >> Yes, he found this case when we tested your original fix for >> ExecReScanAppend() behavior. >> I'm fine with following Etsuro's fix. > > Sorry, I renamed that function. > > I haven't looked at the patches yet, sorry, so I'm missing something, > but do we really need the same treatment here? IMU: what async should > be made for in MergeAppend would be only the initialization step that > that node fetches one tuple from every child to seed the heap; other > steps should be processed rather synchronously, to reduce the overhead > by async. So no pending async requests in ExecReScanMergeAppend. No? > Hi. This seems to be true. On the first call to ExecMergeAppend, ExecMergeAppendAsyncGetNext() would get tuples from all valid asyncplans, and so there would be no requests with callback_pending set to true. Subsequent ExecMergeAppendGetNextSlot() also waits for results, so callback_pending should be also false. -- Best regards, Alexander Pyhalov, Postgres Professional