Re: postgres_fdw: misplaced? comments in connection.c

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: postgres_fdw: misplaced? comments in connection.c
Date: 2021-10-12 04:33:39
Message-ID: CAPmGK14DsTYEMso5MhDQx3ecwph2huck9uXy=hzftQ+B3L5RWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 11, 2021 at 5:05 PM Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com> wrote:
> The comments for pgfdw_get_cleanup_result() say this:
>
> * It's not a huge problem if we throw an ERROR here, but if we get into error
> * recursion trouble, we'll end up slamming the connection shut, which will
> * necessitate failing the entire toplevel transaction even if subtransactions
> * were used. Try to use WARNING where we can.
>
> But we don’t use WARNING anywhere in that function. The right place
> for this is pgfdw_exec_cleanup_query()?

I noticed that pgfdw_cancel_query(), which is called during (sub)abort
cleanup if necessary, also uses WARNING, instead of ERROR, to avoid
the error-recursion-trouble issue. So I think it would be good to
move this to pgfdw_cancel_query() as well as
pgfdw_exec_cleanup_query(). Attached is a patch for that.

Best regards,
Etsuro Fujita

Attachment Content-Type Size
move-misplaced-comments.patch application/octet-stream 2.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-10-12 04:45:48 Re: Rewriting the test of pg_upgrade as a TAP test - take three - remastered set
Previous Message Fujii Masao 2021-10-12 04:25:01 Re: Allow escape in application_name