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 1nKjvc-0006LG-NU for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Feb 2022 16:46:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nKjvb-00065e-0f for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Feb 2022 16:46:47 +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 1nKjva-00065V-NX for pgsql-hackers@lists.postgresql.org; Thu, 17 Feb 2022 16:46:46 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nKjvX-00037v-PD for pgsql-hackers@lists.postgresql.org; Thu, 17 Feb 2022 16:46:45 +0000 Received: from [192.168.11.10] (p2010165-ipbf2302funabasi.chiba.ocn.ne.jp [122.25.95.165]) by oss.nttdata.com (Postfix) with ESMTPSA id E3CFA60796; Fri, 18 Feb 2022 01:46:38 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.5 at oss.nttdata.com Message-ID: <2a2519b5-0c1f-87c8-5461-a4d8be0728e0@oss.nttdata.com> Date: Fri, 18 Feb 2022 01:46:38 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit Content-Language: en-US To: Etsuro Fujita Cc: PostgreSQL Hackers References: <65af8fb4-4c45-9cc3-c6ec-80f3ac488e07@oss.nttdata.com> <95066202-c7e6-e4be-05cc-bdceb45b68c7@oss.nttdata.com> <2d7c480a-63c8-a244-0f2a-361e5097764f@oss.nttdata.com> <3e57ebd7-b536-333e-c877-49a3ebb57079@oss.nttdata.com> From: Fujii Masao In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022/02/11 21:59, Etsuro Fujita wrote: > I tweaked comments/docs a little bit as well. Thanks for updating the patches! I reviewed 0001 patch. It looks good to me except the following minor things. If these are addressed, I think that the 001 patch can be marked as ready for committer. + * Also determine to commit (sub)transactions opened on the remote server + * in parallel at (sub)transaction end. Like the comment "Determine whether to keep the connection ...", "determine to commit" should be "determine whether to commit"? "remote server" should be "remote servers"? + curlevel = GetCurrentTransactionNestLevel(); + snprintf(sql, sizeof(sql), "RELEASE SAVEPOINT s%d", curlevel); Why does pgfdw_finish_pre_subcommit_cleanup() need to call GetCurrentTransactionNestLevel() and construct the "RELEASE SAVEPOINT" query string again? pgfdw_subxact_callback() already does them and probably we can make it pass either of them to pgfdw_finish_pre_subcommit_cleanup() as its argument. + This option controls whether postgres_fdw commits + remote (sub)transactions opened on a foreign server in a local + (sub)transaction in parallel when the local (sub)transaction commits. "a foreign server" should be "foreign servers"? "in a local (sub)transaction" part seems not to be necessary. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION