Re: [BUG] non archived WAL removed during production crash recovery

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, masao(dot)fujii(at)oss(dot)nttdata(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: [BUG] non archived WAL removed during production crash recovery
Date: 2020-04-24 07:05:10
Message-ID: 20200424070510.GM33034@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Thu, Apr 23, 2020 at 06:48:56PM -0700, Andres Freund wrote:
> But don't we pretty much know this already from the state of the system?
> During crash recovery there's nothing running RemoveOldXLogFiles() but
> the startup process. Right? And in DB_IN_ARCHIVE_RECOVERY it should only
> happen as part of restartpoints (i.e. the checkpointer).
>
> Did you add the new shared state to avoid deducing things from the
> "environment"? If so, it should really be mentioned in the commit
> message & code. Because:

Hmm. Sorry, I see your point. The key of the logic here is from
XLogArchiveCheckDone() which could be called from other processes than
the startup process. There is one code path at the end of a base
backup for backup history files where not using a shared state would
be a problem.
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-04-24 10:02:47 BUG #16386: drop contraint in inherited table is missing in pg_dump backup
Previous Message David Rowley 2020-04-24 06:26:49 Re: BUG #15383: Join Filter cost estimation problem in 10.5

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-04-24 07:19:24 Re: HEAPDEBUGALL is broken
Previous Message Pavel Stehule 2020-04-24 06:53:45 proposal - plpgsql - all plpgsql auto variables should be constant