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 1mShVF-0000Jp-PG for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Sep 2021 15:16:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mShVE-0003qF-JJ for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Sep 2021 15:16: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 1mShVE-0003q7-Bf for pgsql-hackers@lists.postgresql.org; Tue, 21 Sep 2021 15:16:12 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mShVB-00062o-Hr for pgsql-hackers@postgresql.org; Tue, 21 Sep 2021 15:16:11 +0000 Received: from hrk.local (p2388012-ipbf1027funabasi.chiba.ocn.ne.jp [118.6.6.12]) by oss.nttdata.com (Postfix) with ESMTPSA id ADAF760993; Wed, 22 Sep 2021 00:16:03 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.3 at oss.nttdata.com Subject: Re: Refactoring postgres_fdw code to rollback remote transaction To: Bharath Rupireddy Cc: Zhihong Yu , PostgreSQL-development References: <62fbb63a-d46c-fb47-a56d-f6be1909aa44@oss.nttdata.com> <2a767435-9a92-a6fb-4b59-a81434dda1ab@oss.nttdata.com> From: Fujii Masao Message-ID: Date: Wed, 22 Sep 2021 00:16:03 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/09/17 15:33, Bharath Rupireddy wrote: > On Fri, Sep 17, 2021 at 8:28 AM Fujii Masao wrote: >> >> On 2021/09/17 11:40, Zhihong Yu wrote: >>> + goto fail; /* Trouble clearing prepared statements */ >>> >>> The label fail can be removed. Under the above condition, entry->changing_xact_state is still true. You can directly return. >> >> Thanks for the review! Yes, you're right. Attached the updated version of the patch. > > +1 for the code refactoring (1 file changed, 75 insertions(+), 102 > deletions(-)). > > The v2 patch looks good to me as is. Thanks for the review! Barring any objection, I will commit the patch. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION