Re: Return value of pg_promote()

2023-08-28 Thread Michael Paquier
On Mon, Aug 28, 2023 at 02:09:37PM +0200, Laurenz Albe wrote: > On Thu, 2023-08-17 at 09:37 +0900, Michael Paquier wrote: > > I have just noticed that we do not have a CF entry for this proposal, > > so I have added one with Laurenz as author: > > https://commitfest.postgresql.org/44/4504/ > > I

Re: Return value of pg_promote()

2023-08-28 Thread Laurenz Albe
On Thu, 2023-08-17 at 09:37 +0900, Michael Paquier wrote: > I have just noticed that we do not have a CF entry for this proposal, > so I have added one with Laurenz as author: > https://commitfest.postgresql.org/44/4504/ I have changed the author to Fujii Masao. Yours, Laurenz Albe

Re: Return value of pg_promote()

2023-08-28 Thread Michael Paquier
On Mon, Aug 28, 2023 at 11:50:45AM +0530, Ashutosh Sharma wrote: > Thanks for reviewing the patch and adding a CF entry for it. PFA patch > that addresses your review comments. That looks OK seen from here. Perhaps others have more comments? > And... Sorry for the delayed response. I totally

Re: Return value of pg_promote()

2023-08-28 Thread Ashutosh Sharma
Hi Michael, On Thu, Aug 17, 2023 at 6:07 AM Michael Paquier wrote: > > On Wed, Aug 16, 2023 at 05:02:09PM +0900, Michael Paquier wrote: > > if (kill(PostmasterPid, SIGUSR1) != 0) > > { > > -ereport(WARNING, > > -(errmsg("failed to send signal to postmaster:

Re: Return value of pg_promote()

2023-08-16 Thread Michael Paquier
On Wed, Aug 16, 2023 at 05:02:09PM +0900, Michael Paquier wrote: > if (kill(PostmasterPid, SIGUSR1) != 0) > { > -ereport(WARNING, > -(errmsg("failed to send signal to postmaster: %m"))); > (void) unlink(PROMOTE_SIGNAL_FILE); > -

Re: Return value of pg_promote()

2023-08-16 Thread Michael Paquier
On Thu, Jun 08, 2023 at 04:53:50PM +0530, Ashutosh Sharma wrote: > Thanks for sharing your thoughts, Laurenz and Fujii-san. I've prepared > a patch that makes pg_promote error out if it couldn't send SIGUSR1 to > the postmaster or if the postmaster died in the middle of standby > promotion. PFA.

Re: Return value of pg_promote()

2023-06-08 Thread Ashutosh Sharma
On Wed, Jun 7, 2023 at 9:55 PM Fujii Masao wrote: > > > > On 2023/06/07 2:00, Laurenz Albe wrote: > > On Tue, 2023-06-06 at 16:35 +0530, Ashutosh Sharma wrote: > >> At present, pg_promote() returns true to the caller on successful > >> promotion of standby, however it returns false in multiple

Re: Return value of pg_promote()

2023-06-07 Thread Fujii Masao
On 2023/06/07 2:00, Laurenz Albe wrote: On Tue, 2023-06-06 at 16:35 +0530, Ashutosh Sharma wrote: At present, pg_promote() returns true to the caller on successful promotion of standby, however it returns false in multiple scenarios which includes: 1) The SIGUSR1 signal could not be sent to

Re: Return value of pg_promote()

2023-06-06 Thread Laurenz Albe
On Tue, 2023-06-06 at 16:35 +0530, Ashutosh Sharma wrote: > At present, pg_promote() returns true to the caller on successful > promotion of standby, however it returns false in multiple scenarios > which includes: > > 1) The SIGUSR1 signal could not be sent to the postmaster process. > 2) The

Return value of pg_promote()

2023-06-06 Thread Ashutosh Sharma
Hi All, At present, pg_promote() returns true to the caller on successful promotion of standby, however it returns false in multiple scenarios which includes: 1) The SIGUSR1 signal could not be sent to the postmaster process. 2) The postmaster died during standby promotion. 3) Standby couldn't