Re: HotStandbyActive() issue in postgres

2021-03-16 Thread Fujii Masao
On 2021/03/16 12:24, Hao Wu wrote: Yes, I have an extension/UDF that needs to know if the server is currently running as hot standby. For example, a UDF foo() wants to run on both the primary and secondary and runs different behaviors for different roles. Promoted secondary looks the same as t

Re: HotStandbyActive() issue in postgres

2021-03-16 Thread Hao Wu
Yes, I have an extension/UDF that needs to know if the server is currently running as hot standby. For example, a UDF foo() wants to run on both the primary and secondary and runs different behaviors for different roles. Promoted secondary looks the same as the primary since it's no longer real hot

Re: HotStandbyActive() issue in postgres

2021-03-12 Thread Fujii Masao
On 2021/03/12 11:14, Hao Wu wrote: Hi hackers, When we enable hot standby, HotStandbyActive() returns true on hot standby. Then, we promote the hot standby, the SHM variable `XLogCtl->SharedHotStandbyActive` remains true. So, HotStandbyActive() still returns true until the next call of `XLOG