Re: Assertion failure in WaitForWALToBecomeAvailable state machine - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Assertion failure in WaitForWALToBecomeAvailable state machine
Date
Msg-id CALj2ACXn=VKYTp_cnien4KqyWNsFVz6EJC5jV7fU1GV18_XBOQ@mail.gmail.com
Whole thread Raw
In response to Re: Assertion failure in WaitForWALToBecomeAvailable state machine  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Assertion failure in WaitForWALToBecomeAvailable state machine
List pgsql-hackers
On Thu, Aug 11, 2022 at 10:06 PM Bharath Rupireddy
<bharath.rupireddyforpostgres@gmail.com> 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 state machine moves to archive and
> hence the following XLogShutdownWalRcv() code will not get hit:
>
>                     /*
>                      * Before we leave XLOG_FROM_STREAM state, make sure that
>                      * walreceiver is not active, so that it won't overwrite
>                      * WAL that we restore from archive.
>                      */
>                     if (WalRcvStreaming())
>                         ShutdownWalRcv();
>
> I agree with Kyotaro-san to reset InstallXLogFileSegmentActive before
> entering into the archive mode. Hence I tweaked the code introduced by
> the following commit a bit, the result v1 patch is attached herewith.
> Please review it.

I added it to the current commitfest to not lose track of it:
https://commitfest.postgresql.org/39/3814/.

-- 
Bharath Rupireddy
RDS Open Source Databases: https://aws.amazon.com/rds/postgresql/



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Cleaning up historical portability baggage
Next
From: Bharath Rupireddy
Date:
Subject: Re: Use SetInstallXLogFileSegmentActive() for setting XLogCtl->InstallXLogFileSegmentActive