Re: Assertion failure in WaitForWALToBecomeAvailable state machine
Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-08-15T06:00:49Z
Lists: 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/
Commits
-
Reset InstallXLogFileSegmentActive after walreceiver self-initiated exit.
- 69a498eb6465 13.21 landed
- 3635a0a35aaf 14.18 landed
- e36cbef04bd5 15.0 landed
- b4f584f9d2a1 16.0 landed
-
Skip WAL recycling and preallocation during archive recovery.
- cc2c7d65fc27 15.0 cited