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 1nLBDv-000892-8Q for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Feb 2022 21:55:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nLBDt-0005RW-PO for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Feb 2022 21:55:29 +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 1nLBDt-0005RN-Db for pgsql-hackers@lists.postgresql.org; Fri, 18 Feb 2022 21:55:29 +0000 Received: from sender4-op-o11.zoho.com ([136.143.188.11]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nLBDq-00007X-Kv for pgsql-hackers@lists.postgresql.org; Fri, 18 Feb 2022 21:55:28 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1645221321; cv=none; d=zohomail.com; s=zohoarc; b=Ple+ph3Tefo7ncXXxt3r4lYfWTsBEJmOyuTA4MQt7LawFPYiAOquwQ+It1WIX74tWerkqQpZhtCs7lSDYZPpxcNk/sihSLHLnJ9Nt8Zow2mougO4H8OJQK5RhaQgf6Wf+T2oMTrtRkV+wXwGOEOrDSpcm9ZCYy11z+IgJ5cd9k0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645221321; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=iPqlrFtuPLzDssIiPwNnqBT93MGwd+gZ5r9ZhF4Dx5w=; b=kp6G3vYqWkQaJHeUV0FWVyI0/Y7bM+9cqH3XUrqjK2fYiUtIaH3HqczU1zt0Z6mU91ZLCbcDACcShZ0UneeMyv/36GJiCIKBVqVfIfjETWD60jySW02GlP+GuXeos89Byvmr35QHTg1eGe4uKkTNPg7xhSOXa6m9gBM3d+tH9/A= 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=1645221321; s=zoho; d=highgo.ca; i=david.zhang@highgo.ca; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=iPqlrFtuPLzDssIiPwNnqBT93MGwd+gZ5r9ZhF4Dx5w=; b=bSSO+YSFI3PE8dqtacKU4hieaTuOn9Th8FLdTacktINg9bAH6vDZpEz4Yn0NohTS NmplxWfsLXZ0Nah6IGned9CSlCRp51iNrTVhkMQXzROltHNJZKrQg49dxk77NvQy0GB nh3LXaeb82jW+38FeYmrLHTB55YljE80QEVqLWmU= Received: from [192.168.1.72] (d64-180-13-33.bchsia.telus.net [64.180.13.33]) by mx.zohomail.com with SMTPS id 1645221320649115.94374134516852; Fri, 18 Feb 2022 13:55:20 -0800 (PST) Message-ID: <66d99132-5946-ba74-ffa6-620eb50b7a8f@highgo.ca> Date: Fri, 18 Feb 2022 13:55:19 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit Content-Language: en-US To: Fujii Masao , 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> <2a2519b5-0c1f-87c8-5461-a4d8be0728e0@oss.nttdata.com> From: David Zhang In-Reply-To: <2a2519b5-0c1f-87c8-5461-a4d8be0728e0@oss.nttdata.com> 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 updating the patch. Tried to apply the patches to master branch, no warning found and regression test passed. Now, we have many places (5) calling the same function with a constant number 30000. Is this a good time to consider redefine this number a macro somewhere? Thank you, On 2022-02-17 8:46 a.m., Fujii Masao wrote: > > > 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, > -- David Software Engineer Highgo Software Inc. (Canada) www.highgo.ca