Re: Refactoring postgres_fdw code to rollback remote transaction

2021-09-22 Thread Fujii Masao
On 2021/09/22 0:16, Fujii Masao wrote: Thanks for the review! Barring any objection, I will commit the patch. Pushed. Thanks! Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION

Re: Refactoring postgres_fdw code to rollback remote transaction

2021-09-21 Thread Fujii Masao
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_xa

Re: Refactoring postgres_fdw code to rollback remote transaction

2021-09-16 Thread Bharath Rupireddy
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 dir

Re: Refactoring postgres_fdw code to rollback remote transaction

2021-09-16 Thread Fujii Masao
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

Re: Refactoring postgres_fdw code to rollback remote transaction

2021-09-16 Thread Zhihong Yu
On Thu, Sep 16, 2021 at 7:31 PM Fujii Masao wrote: > Hi, > > In postgres_fdw, pgfdw_xact_callback() and pgfdw_subxact_callback() do > almost the same thing to rollback remote toplevel- and sub-transaction. > But their such rollback logics are implemented separately and > in different way. Which w

Refactoring postgres_fdw code to rollback remote transaction

2021-09-16 Thread Fujii Masao
Hi, In postgres_fdw, pgfdw_xact_callback() and pgfdw_subxact_callback() do almost the same thing to rollback remote toplevel- and sub-transaction. But their such rollback logics are implemented separately and in different way. Which would decrease the readability and maintainability, I think. So