Re: [Proposal] Add foreign-server health checks infrastructure

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: "kuroda(dot)hayato(at)fujitsu(dot)com" <kuroda(dot)hayato(at)fujitsu(dot)com>, "zyu(at)yugabyte(dot)com" <zyu(at)yugabyte(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, 'Shinya Kato' <Shinya11(dot)Kato(at)oss(dot)nttdata(dot)com>
Subject: Re: [Proposal] Add foreign-server health checks infrastructure
Date: 2022-01-23 05:36:02
Message-ID: 0e9ea094-67df-487c-96f5-f9eabb5357c7@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2022/01/21 15:08, kuroda(dot)hayato(at)fujitsu(dot)com wrote:
> Dear Fujii-san, Zhihong,
>
> I attached the latest version.

Thanks for updating the patch!

+int
+TryDisableRemoteServerCheckingTimeout(void)

When more than one FDWs are used, even if one FDW calls this function to disable the timeout, its remote-server-check-callback can still be called. Is this OK?
Please imagine the case where two FDWs are used and they registered their callbacks. Even when one FDW calls TryDisableRemoteServerCheckingTimeout(), if another FDW has not called that yet, the timeout is still being enabled. If the timeout is triggered during that period, even the callback registered by the FDW that has already called TryDisableRemoteServerCheckingTimeout() would be called.

+ if (remote_servers_connection_check_interval > 0)
+ {
+ CallCheckingRemoteServersCallbacks();
+ enable_timeout_after(CHECKING_REMOTE_SERVERS_TIMEOUT,
+ remote_servers_connection_check_interval);

LockErrorCleanup() needs to be called before reporting the error, doesn't it?

This can cause an error even while DoingCommandRead == true. Is that safe?

> The biggest change is that callbacks are no longer un-registered at the end of transactions.
> FDW developer must enable or disable timeout instead, via new APIs.
>
> The timer will be turned on when:
> * new GUC is >= 0, and

This can cause the timeout to be enabled even when no remote transaction is started?

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2022-01-23 08:10:34 Re: Schema variables - new implementation for Postgres 15
Previous Message James Coleman 2022-01-23 01:25:19 Re: Parallelize correlated subqueries that execute within each worker