Re: Refactoring postgres_fdw code to rollback remote transaction

From: Zhihong Yu <zyu(at)yugabyte(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Refactoring postgres_fdw code to rollback remote transaction
Date: 2021-09-17 02:40:06
Message-ID: CALNJ-vSBpE6q6u+6rb78HWjKEF58-bt4_s+r8dLn=1wjUZ-wQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 16, 2021 at 7:31 PM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
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 would decrease the readability and maintainability,
> I think. So how about making the common function so that those callback
> functions can just use it? Patch attached.
>
> Regards,
>
> --
> Fujii Masao
> Advanced Computing Technology Center
> Research and Development Headquarters
> NTT DATA CORPORATION
>
Hi,

+ 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.

Cheers

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2021-09-17 02:58:35 Re: Refactoring postgres_fdw code to rollback remote transaction
Previous Message Fujii Masao 2021-09-17 02:31:38 Refactoring postgres_fdw code to rollback remote transaction