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 1nmMiH-0002RL-U8 for pgsql-hackers@arkaria.postgresql.org; Wed, 04 May 2022 21:39:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nmMiG-0007yE-KK for pgsql-hackers@arkaria.postgresql.org; Wed, 04 May 2022 21:39:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmMiG-0007y5-9f for pgsql-hackers@lists.postgresql.org; Wed, 04 May 2022 21:39:12 +0000 Received: from sender4-op-o11.zoho.com ([136.143.188.11]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nmMiA-0004YM-Rk for pgsql-hackers@lists.postgresql.org; Wed, 04 May 2022 21:39:11 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1651700340; cv=none; d=zohomail.com; s=zohoarc; b=K6kTlEKHOpTSXscKocTkvWZhjKc2xX4ZgZgMKx7AFVxaBx4lne887YgsKXW6xAgUHr2FC5PT6ydujy7v5faVlyXfUqgOcNfDbqF8H5LUkosmx8SWJlDJi+ecx6+p4PG4FS5wOMQK71V72Qe1h0GTjVq8dzCWOuXMCgOf4XorX9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651700340; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=KdOqXrD8GsdLnIpX2lUE+pkgyLWBd0luTL1clmrZTKg=; b=IDx2kWtzCMQ5Jwni27+JiygcZDnz3htO/S2j2oiY0xg3Bc5hacFcEC7qEJg8wjo0aAHYlxxBsPPEWUoghGK+uPBivHee/jHnTNwl+vzzfIax2GuawUs+L2mrgPNUp3IKbCtCupx6qTHedePHxQ+yo7KgPI/tFQ2Bve1nLww4nNM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=highgo.ca; spf=pass smtp.mailfrom=david.zhang@highgo.ca; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1651700340; s=zoho; d=highgo.ca; i=david.zhang@highgo.ca; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=KdOqXrD8GsdLnIpX2lUE+pkgyLWBd0luTL1clmrZTKg=; b=c69Dik6nkHnrLj2gxN5SQfr/VOLIEkeCYXIw4JqGkBxkyWvkkZ+KLabHyOF83NEG W/zw8G5/vjihtj9RtIkD2B2IJLibJYJ4UcuREaHN3nOQIr0zxWwAEWuygScxjKrm3M4 +Q/g5dLxe/2R5DeaEaP5Y4NdRP2B05bTiefelZh8= Received: from [192.168.1.72] (d64-180-13-33.bchsia.telus.net [64.180.13.33]) by mx.zohomail.com with SMTPS id 1651700336990156.93347339580941; Wed, 4 May 2022 14:38:56 -0700 (PDT) Message-ID: <7e6f4400-ad1c-c87d-42b8-ad906e0ed39e@highgo.ca> Date: Wed, 4 May 2022 14:38:54 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit Content-Language: en-US To: Etsuro Fujita Cc: Fujii Masao , PostgreSQL Hackers References: <3e57ebd7-b536-333e-c877-49a3ebb57079@oss.nttdata.com> <2a2519b5-0c1f-87c8-5461-a4d8be0728e0@oss.nttdata.com> <883589bb-077f-7d66-2406-5f67be0372a6@oss.nttdata.com> From: David Zhang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ZohoMailClient: External List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thanks a lot for the patch update. On 2022-05-02 1:25 a.m., Etsuro Fujita wrote: > Hi, > > On Wed, Apr 20, 2022 at 4:55 AM David Zhang wrote: >> I tried to apply the patch to master and plan to run some tests, but got >> below errors due to other commits. > I rebased the patch against HEAD. Attached is an updated patch. Applied the patch v8 to master branch today, and the `make check` is OK. I also repeated previous performance tests on three virtual Ubuntu 18.04, and the performance improvement of parallel abort in 10 times average is more consistent. before:     abort.1 = 2.6344 ms     abort.2 = 4.2799 ms after:     abort.1 = 1.4105 ms     abort.2 = 2.2075 ms >> + * remote server in parallel at (sub)transaction end. >> >> Here, I think the comment above could potentially apply to multiple >> remote server(s). > I agree on that point, but I think it's correct to say "the remote > server" here, because we determine this for the given remote server. > Maybe I'm missing something, so could you elaborate on it? Your understanding is correct. I was thinking `remote server(s)` would be easy for end user to understand but this is a comment in source code, so either way is fine for me. >> Not sure if there is a way to avoid repeated comments? For example, the >> same comment below appears in two places (line 231 and line 296). >> >> + /* >> + * If requested, consume whatever data is available from the socket. >> + * (Note that if all data is available, this allows >> + * pgfdw_get_cleanup_result to call PQgetResult without forcing the >> + * overhead of WaitLatchOrSocket, which would be large compared to the >> + * overhead of PQconsumeInput.) >> + */ > IMO I think it's OK to have this in multiple places, because 1) IMO it > wouldn't be that long, and 2) we already duplicated comments like this > in the same file in v14 and earlier. Here is such an example in > pgfdw_xact_callback() and pgfdw_subxact_callback() in that file in > those versions: > > /* > * If a command has been submitted to the remote server by > * using an asynchronous execution function, the command > * might not have yet completed. Check to see if a > * command is still being processed by the remote server, > * and if so, request cancellation of the command. > */ > > Thanks for reviewing! Sorry for the delay. > > Best regards, > Etsuro Fujita -- Best regards, David Software Engineer Highgo Software Inc. (Canada) www.highgo.ca