Re: pg_promote() can cause busy loop

2019-09-05 Thread Fujii Masao
On Thu, Sep 5, 2019 at 4:52 PM Michael Paquier wrote: > > On Thu, Sep 05, 2019 at 04:03:22PM +0900, Fujii Masao wrote: > > So, barring any objection, I will commit the attached patch. > > LGTM. Thanks! Committed. Thanks! Regards, -- Fujii Masao

Re: pg_promote() can cause busy loop

2019-09-05 Thread Michael Paquier
On Thu, Sep 05, 2019 at 04:03:22PM +0900, Fujii Masao wrote: > So, barring any objection, I will commit the attached patch. LGTM. Thanks! -- Michael signature.asc Description: PGP signature

Re: pg_promote() can cause busy loop

2019-09-05 Thread Fujii Masao
On Thu, Sep 5, 2019 at 11:10 AM Michael Paquier wrote: > > On Thu, Sep 05, 2019 at 10:53:19AM +0900, Fujii Masao wrote: > > It's ok to use PG_RETURN_BOOL(false) instead of breaking out of the loop > > in that case. Which would make the code simpler. > > Okay. I would have done so FWIW. > > > But

Re: pg_promote() can cause busy loop

2019-09-04 Thread Fujii Masao
On Thu, Sep 5, 2019 at 10:26 AM Michael Paquier wrote: > > On Thu, Sep 05, 2019 at 09:46:26AM +0900, Fujii Masao wrote: > > I found small issue in pg_promote(). If postmaster dies > > while pg_promote() is waiting for the standby promotion to finish, > > pg_promote() c

Re: pg_promote() can cause busy loop

2019-09-04 Thread Michael Paquier
On Thu, Sep 05, 2019 at 10:53:19AM +0900, Fujii Masao wrote: > It's ok to use PG_RETURN_BOOL(false) instead of breaking out of the loop > in that case. Which would make the code simpler. Okay. I would have done so FWIW. > But I don't think it's worth warning about postmaster death here > because

Re: pg_promote() can cause busy loop

2019-09-04 Thread Michael Paquier
On Thu, Sep 05, 2019 at 09:46:26AM +0900, Fujii Masao wrote: > I found small issue in pg_promote(). If postmaster dies > while pg_promote() is waiting for the standby promotion to finish, > pg_promote() can cause busy loop. This happens because > pg_promote() does nothing when WaitLat

pg_promote() can cause busy loop

2019-09-04 Thread Fujii Masao
Hi, I found small issue in pg_promote(). If postmaster dies while pg_promote() is waiting for the standby promotion to finish, pg_promote() can cause busy loop. This happens because pg_promote() does nothing when WaitLatch() detects the postmaster death event. I think that pg_promote() should