Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-09-15 Thread Kyotaro Horiguchi
At Fri, 16 Sep 2022 09:05:46 +0900, Michael Paquier wrote in > On Thu, Sep 15, 2022 at 06:58:43AM -0700, Noah Misch wrote: > > Pushed that way. > > Thanks for taking care of it, Noah. +1. Thanks. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-09-15 Thread Michael Paquier
On Thu, Sep 15, 2022 at 06:58:43AM -0700, Noah Misch wrote: > Pushed that way. Thanks for taking care of it, Noah. -- Michael signature.asc Description: PGP signature

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-09-15 Thread Noah Misch
On Tue, Sep 13, 2022 at 11:56:16AM +0530, Bharath Rupireddy wrote: > On Tue, Sep 13, 2022 at 8:52 AM Noah Misch wrote: > > > > > [1] - > > > > > https://www.postgresql.org/message-id/flat/20220909.172949.2223165886970819060.horikyota.ntt%40gmail.com > > > > I plan to use that message's patch, bec

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-09-15 Thread Bharath Rupireddy
On Tue, Sep 13, 2022 at 3:56 PM Kyotaro Horiguchi wrote: > > > is that XLogShutdownWalRcv() does a bunch of work via ShutdownWalRcv() > > - it calls ConditionVariablePrepareToSleep(), > > Anyway the code path is executed in almost all cases because the same > assertion fires otherwise. So I don't

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-09-13 Thread Kyotaro Horiguchi
At Tue, 13 Sep 2022 11:56:16 +0530, Bharath Rupireddy wrote in > On Tue, Sep 13, 2022 at 8:52 AM Noah Misch wrote: > > > > > > > [1] - > > > > > https://www.postgresql.org/message-id/flat/20220909.172949.2223165886970819060.horikyota.ntt%40gmail.com > > > > I plan to use that message's patch,

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-09-12 Thread Bharath Rupireddy
On Tue, Sep 13, 2022 at 8:52 AM Noah Misch wrote: > > > > > [1] - > > > > https://www.postgresql.org/message-id/flat/20220909.172949.2223165886970819060.horikyota.ntt%40gmail.com > > I plan to use that message's patch, because it guarantees WALRCV_STOPPED at > the code location being changed. To

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-09-12 Thread Michael Paquier
On Mon, Sep 12, 2022 at 08:22:56PM -0700, Noah Misch wrote: > I plan to use that message's patch, because it guarantees WALRCV_STOPPED at > the code location being changed. Today, in the unlikely event of > !WalRcvStreaming() due to WALRCV_WAITING or WALRCV_STOPPING, that code > proceeds without w

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-09-12 Thread Noah Misch
On Mon, Sep 12, 2022 at 05:58:08PM +0530, Bharath Rupireddy wrote: > On Mon, Sep 12, 2022 at 12:30 PM Michael Paquier wrote: > > On Sat, Sep 10, 2022 at 07:52:01AM +0530, Bharath Rupireddy wrote: > > > Just for the records - there's another report of the assertion failure > > > at [1], many thanks

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-09-12 Thread Bharath Rupireddy
On Mon, Sep 12, 2022 at 12:30 PM Michael Paquier wrote: > > On Sat, Sep 10, 2022 at 07:52:01AM +0530, Bharath Rupireddy wrote: > > Today, I spent some more time on this issue, I modified the v1 patch > > posted upthread a bit - now resetting the InstallXLogFileSegmentActive > > only when the WAL s

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-09-12 Thread Michael Paquier
On Sat, Sep 10, 2022 at 07:52:01AM +0530, Bharath Rupireddy wrote: > Today, I spent some more time on this issue, I modified the v1 patch > posted upthread a bit - now resetting the InstallXLogFileSegmentActive > only when the WAL source switched to archive, not every time in > archive mode. > > I

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-09-09 Thread Bharath Rupireddy
On Mon, Aug 15, 2022 at 11:30 AM Bharath Rupireddy wrote: > > On Thu, Aug 11, 2022 at 10:06 PM Bharath Rupireddy > wrote: > > > > Today I encountered the assertion failure [2] twice while working on > > another patch [1]. The pattern seems to be that the walreceiver got > > killed or crashed and

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-08-14 Thread Bharath Rupireddy
On Thu, Aug 11, 2022 at 10:06 PM Bharath Rupireddy wrote: > > Today I encountered the assertion failure [2] twice while working on > another patch [1]. The pattern seems to be that the walreceiver got > killed or crashed and set it's state to WALRCV_STOPPING or > WALRCV_STOPPED by the team the WAL

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-08-11 Thread Bharath Rupireddy
On Mon, Feb 14, 2022 at 1:44 PM Kyotaro Horiguchi wrote: > > At Fri, 11 Feb 2022 22:25:49 +0530, Bharath Rupireddy > wrote in > > > I don't think > > > > just making InstallXLogFileSegmentActive false is enough. By looking > > > > at the comment [1], it doesn't make sense to move ahead for resto

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-02-14 Thread Kyotaro Horiguchi
At Fri, 11 Feb 2022 22:25:49 +0530, Bharath Rupireddy wrote in > > I don't think > > > just making InstallXLogFileSegmentActive false is enough. By looking > > > at the comment [1], it doesn't make sense to move ahead for restoring > > > from the archive location without the WAL receiver fully s

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-02-11 Thread Bharath Rupireddy
On Fri, Feb 11, 2022 at 6:31 PM Dilip Kumar wrote: > > On Fri, Feb 11, 2022 at 6:22 PM Bharath Rupireddy > wrote: > > > > On Fri, Feb 11, 2022 at 3:33 PM Dilip Kumar wrote: > > > > > > IIUC, the issue can happen while the walreceiver failed to get WAL > > from primary for whatever reasons and it

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-02-11 Thread Dilip Kumar
On Fri, Feb 11, 2022 at 6:22 PM Bharath Rupireddy wrote: > > On Fri, Feb 11, 2022 at 3:33 PM Dilip Kumar wrote: > > > IIUC, the issue can happen while the walreceiver failed to get WAL > from primary for whatever reasons and its status is not > WALRCV_STOPPING or WALRCV_STOPPED, and the startup

Re: Assertion failure in WaitForWALToBecomeAvailable state machine

2022-02-11 Thread Bharath Rupireddy
On Fri, Feb 11, 2022 at 3:33 PM Dilip Kumar wrote: > > Hi, > > The problem is that whenever we are going for streaming we always set > XLogCtl->InstallXLogFileSegmentActive to true, but while switching > from streaming to archive we do not always reset it so it hits > assertion in some cases. Basi

Assertion failure in WaitForWALToBecomeAvailable state machine

2022-02-11 Thread Dilip Kumar
Hi, The problem is that whenever we are going for streaming we always set XLogCtl->InstallXLogFileSegmentActive to true, but while switching from streaming to archive we do not always reset it so it hits assertion in some cases. Basically we reset it inside XLogShutdownWalRcv() but while switching