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 1kKhmk-0000Ep-T1 for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Sep 2020 12:52:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kKhmi-0006jS-OM for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Sep 2020 12:52:40 +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 1kKhmi-0006jL-D7 for pgsql-hackers@lists.postgresql.org; Tue, 22 Sep 2020 12:52:40 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kKhme-00040r-7u for pgsql-hackers@lists.postgresql.org; Tue, 22 Sep 2020 12:52:39 +0000 Received: from [192.168.27.200] (unknown [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 8556F21C3057; Tue, 22 Sep 2020 15:52:33 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1600779153; bh=wGX4ZlUmPm3vDwvnYwZ5PLY2uK8YjZOjZ1NA5yZC+EI=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=FW5R0gPiFc6xAJ22K/qxKiwzSOJJ5GRWzZe8VgA+u3oT7fZfE+/SlbENmPezO9c1w 9jz4x5S/XMuCbbteCIFfy7QeYLyx2q3GQscimptqflRzCmHgjjRftySfR2MbFiCuiY 9pU9CtVZw1CivK7tHdZcy/q03INfrjsYui8QpEP8= Subject: Re: Asynchronous Append on postgres_fdw nodes. To: Kyotaro Horiguchi , pryzby@telsasoft.com Cc: a.lepikhov@postgrespro.ru, etsuro.fujita@gmail.com, movead.li@highgo.ca, pgsql-hackers@lists.postgresql.org References: <20200610.120510.2075667454883130505.horikyota.ntt@gmail.com> <20200702.111448.2019475770338322857.horikyota.ntt@gmail.com> <20200820042536.GB2886@telsasoft.com> <20200820.163608.1893015081639298019.horikyota.ntt@gmail.com> From: Konstantin Knizhnik Message-ID: <84ea4412-5c0e-9a9c-df04-79033fc066da@postgrespro.ru> Date: Tue, 22 Sep 2020 15:52:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20200820.163608.1893015081639298019.horikyota.ntt@gmail.com> Content-Type: multipart/mixed; boundary="------------69E4F92C84C205D3BF6B459E" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------69E4F92C84C205D3BF6B459E Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit On 20.08.2020 10:36, Kyotaro Horiguchi wrote: > At Wed, 19 Aug 2020 23:25:36 -0500, Justin Pryzby wrote in >> On Thu, Jul 02, 2020 at 11:14:48AM +0900, Kyotaro Horiguchi wrote: >>> As the result of a discussion with Fujita-san off-list, I'm going to >>> hold off development until he decides whether mine or Thomas' is >>> better. >> The latest patch doesn't apply so I set as WoA. >> https://commitfest.postgresql.org/29/2491/ > Thanks. This is rebased version. > > At Fri, 14 Aug 2020 13:29:16 +1200, Thomas Munro wrote in >> Either way, we definitely need patch 0001. One comment: >> >> -CreateWaitEventSet(MemoryContext context, int nevents) >> +CreateWaitEventSet(MemoryContext context, ResourceOwner res, int nevents) >> >> I wonder if it's better to have it receive ResourceOwner like that, or >> to have it capture CurrentResourceOwner. I think the latter is more >> common in existing code. > There's no existing WaitEventSets belonging to a resowner. So > unconditionally capturing CurrentResourceOwner doesn't work well. I > could pass a bool instead but that make things more complex. > > Come to think of "complex", ExecAsync stuff in this patch might be > too-much for a short-term solution until executor overhaul, if it > comes shortly. (the patch of mine here as a whole is like that, > though..). The queueing stuff in postgres_fdw is, too. > > regards. > Hi, Looks like current implementation of asynchronous append incorrectly handle LIMIT clause: psql:append.sql:10: ERROR:  another command is already in progress CONTEXT:  remote SQL command: CLOSE c1 -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company --------------69E4F92C84C205D3BF6B459E Content-Type: application/sql; name="append.sql" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="append.sql" Q1JFQVRFIEVYVEVOU0lPTiBwb3N0Z3Jlc19mZHc7CmNyZWF0ZSB0YWJsZSBwdCAoaWQgaW50 ZWdlciwgcGF5bG9hZCBpbnRlZ2VyKSBwYXJ0aXRpb24gYnkgaGFzaChpZCk7CkNSRUFURSBT RVJWRVIgc3J2IEZPUkVJR04gREFUQSBXUkFQUEVSIHBvc3RncmVzX2ZkdyBPUFRJT05TIChk Ym5hbWUgJ3Bvc3RncmVzJyk7CkNSRUFURSBVU0VSIE1BUFBJTkcgRk9SIENVUlJFTlRfVVNF UiBTRVJWRVIgc3J2OwpjcmVhdGUgZm9yZWlnbiB0YWJsZSBmdF8xIHBhcnRpdGlvbiBvZiBw dCBmb3IgdmFsdWVzIHdpdGggKG1vZHVsdXMgMiwgcmVtYWluZGVyIDApIHNlcnZlciBzcnYg b3B0aW9ucyAodGFibGVfbmFtZSAncHRfMScpOwpjcmVhdGUgZm9yZWlnbiB0YWJsZSBmdF8y IHBhcnRpdGlvbiBvZiBwdCBmb3IgdmFsdWVzIHdpdGggKG1vZHVsdXMgMiwgcmVtYWluZGVy IDEpIHNlcnZlciBzcnYgb3B0aW9ucyAodGFibGVfbmFtZSAncHRfMicpOwpjcmVhdGUgdGFi bGUgcHRfMSAoaWQgaW50ZWdlciwgcGF5bG9hZCBpbnRlZ2VyKTsKY3JlYXRlIHRhYmxlIHB0 XzIgKGlkIGludGVnZXIsIHBheWxvYWQgaW50ZWdlcik7CklOU0VSVCBJTlRPIHB0IFNFTEVD VCBzLCBzLzIwIEZST00gZ2VuZXJhdGVfc2VyaWVzKDEsIDEwMDAwKSBzOwpTRUxFQ1QgKiBG Uk9NIHB0IExJTUlUIDEwOwoK --------------69E4F92C84C205D3BF6B459E--