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

2022-02-02 Thread kuroda.hay...@fujitsu.com
Dear Fujii-san, Thank you for good suggestions. > This logic sounds complicated to me. I'm afraid that FDW developers may a bit > easily misunderstand the logic and make the bug in their FDW. > Isn't it simpler to just disable the timeout in core whenever the transaction > ends > whether committ

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

2022-02-01 Thread Fujii Masao
On 2022/02/01 13:37, kuroda.hay...@fujitsu.com wrote: Dear Fujii-san, Thank you for reviewing! I attached the latest version. Thanks! Indeed and it should be avoided. I added a counter to CheckingRemoteServersCallbackItem. The register function returns the registered item, and it must be

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

2022-01-31 Thread kuroda.hay...@fujitsu.com
Dear Fujii-san, Thank you for reviewing! I attached the latest version. > 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 th

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

2022-01-22 Thread Fujii Masao
On 2022/01/21 15:08, kuroda.hay...@fujitsu.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

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

2022-01-20 Thread kuroda.hay...@fujitsu.com
Dear Fujii-san, Zhihong, I attached the latest version. 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 * anyone calls TryEnab

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

2022-01-20 Thread kuroda.hay...@fujitsu.com
Dear Fujii-san, Thank you for your interest! I'll post new version within several days. > > Yeah, remote-checking timeout will be enable even ifa local transaction is > opened. > > In my understanding, postgres cannot distinguish whether opening > > transactions > > are using only local object o

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

2022-01-19 Thread kuroda.hay...@fujitsu.com
Dear Zhihong, Thank you for reviewing! And I have to apologize for the late. I'll post new patchset later. > + UnregisterAllCheckingRemoteServersCallback(); > > UnregisterAllCheckingRemoteServersCallback > -> UnregisterAllCheckingRemoteServersCallbacks Will fix. > + CheckingRemoteServe

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

2022-01-18 Thread Fujii Masao
On 2021/12/15 15:40, kuroda.hay...@fujitsu.com wrote: Yeah, remote-checking timeout will be enable even ifa local transaction is opened. In my understanding, postgres cannot distinguish whether opening transactions are using only local object or not. My first idea was that turning on the time

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

2022-01-05 Thread Zhihong Yu
On Tue, Jan 4, 2022 at 10:21 PM Shinya Kato wrote: > Thank you for the new patch! > > On 2021-12-15 15:40, kuroda.hay...@fujitsu.com wrote: > > Dear Kato-san, > > > > Thank you for giving comments! And sorry for late reply. > > I rebased my patches. > > > >> Even for local-only transaction, I tho

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

2022-01-04 Thread Shinya Kato
Thank you for the new patch! On 2021-12-15 15:40, kuroda.hay...@fujitsu.com wrote: Dear Kato-san, Thank you for giving comments! And sorry for late reply. I rebased my patches. Even for local-only transaction, I thought it useless to execute CallCheckingRemoteServersCallbacks() and enable_tim

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

2021-12-14 Thread kuroda.hay...@fujitsu.com
Dear Kato-san, Thank you for giving comments! And sorry for late reply. I rebased my patches. > Even for local-only transaction, I thought it useless to execute > CallCheckingRemoteServersCallbacks() and enable_timeout_after(). Can I > make it so that it determines outside whether it contains SQL

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

2021-12-06 Thread Shinya Kato
On 2021-11-29 21:36, Zhihong Yu wrote: On Mon, Nov 29, 2021 at 12:51 AM kuroda.hay...@fujitsu.com wrote: Dear Zhihong, Thank you for giving comments! I'll post new patches later. +#define HOLD_CHECKING_REMOTE_SERVERS_INTERRUPTS() (CheckingRemoteServersHoldoffCount++) The macro contains o

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

2021-11-29 Thread Zhihong Yu
On Mon, Nov 29, 2021 at 12:51 AM kuroda.hay...@fujitsu.com < kuroda.hay...@fujitsu.com> wrote: > Dear Zhihong, > > Thank you for giving comments! I'll post new patches later. > > > +#define HOLD_CHECKING_REMOTE_SERVERS_INTERRUPTS() > (CheckingRemoteServersHoldoffCount++) > > > > The macro contains

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

2021-11-29 Thread kuroda.hay...@fujitsu.com
Dear Hackers, I attached new version that is based from Zhihong's comments. And I newly attached a doc patch. I think the infrastructure part is no longer WIP. Could you review them? Best Regards, Hayato Kuroda FUJITSU LIMITED <> v04_0001_add_checking_infrastracture.patch Description: v04_0

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

2021-11-29 Thread kuroda.hay...@fujitsu.com
Dear Zhihong, Thank you for giving comments! I'll post new patches later. > +#define HOLD_CHECKING_REMOTE_SERVERS_INTERRUPTS() > (CheckingRemoteServersHoldoffCount++) > > The macro contains only one operation. Can the macro be removed (with > `CheckingRemoteServersHoldoffCount++` inlined) ?

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

2021-11-28 Thread Zhihong Yu
On Tue, Nov 23, 2021 at 8:57 PM kuroda.hay...@fujitsu.com < kuroda.hay...@fujitsu.com> wrote: > Dear Kato-san, > > Thank you for reviewing! > > > Thank you for sending the patches! > > I confirmed that they can be compiled and tested successfully on CentOS > > 8. > > Thanks! > > > + { > > +

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

2021-11-23 Thread kuroda.hay...@fujitsu.com
Dear Kato-san, I found the missing space, and I added a test. I'm very happy if you review this. Best Regards, Hayato Kuroda FUJITSU LIMITED v03_0001_add_checking_infrastracture.patch Description: v03_0001_add_checking_infrastracture.patch <>

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

2021-11-23 Thread kuroda.hay...@fujitsu.com
Dear Kato-san, Thank you for reviewing! > Thank you for sending the patches! > I confirmed that they can be compiled and tested successfully on CentOS > 8. Thanks! > + { > + {"remote_servers_connection_check_interval", PGC_USERSET, > CONN_AUTH_SETTINGS, > + g

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

2021-11-19 Thread Shinya Kato
On 2021-11-18 21:43, kuroda.hay...@fujitsu.com wrote: Dear Kato-san, Thank you for your interest! > I also want you to review the postgres_fdw part, > but I think it should not be attached because cfbot cannot understand > such a dependency > and will throw build error. Do you know how to deal

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

2021-11-18 Thread kuroda.hay...@fujitsu.com
Dear Kato-san, Thank you for your interest! > > I also want you to review the postgres_fdw part, > > but I think it should not be attached because cfbot cannot understand > > such a dependency > > and will throw build error. Do you know how to deal with them in this > > case? > > I don't know ho

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

2021-11-15 Thread Shinya Kato
Hi, Thank you for the patch! On 2021-10-30 12:50, kuroda.hay...@fujitsu.com wrote: ## Background Currently there is no way to check the status of an foreign server in PostgreSQL. If an foreign server's postmaster goes down, or if the network between servers is lost, the backend process will on

[Proposal] Add foreign-server health checks infrastructure

2021-10-29 Thread kuroda.hay...@fujitsu.com
Dear Hackers, I want to propose the feature that checks the health of foreign servers. As a first step I want to add an infrastructure for periodical checking to PostgreSQL core. Currently this is the WIP, it does not contain docs. ## Background Currently there is no way to check the status o

<    1   2