RE: Stronger safeguard for archive recovery not to miss data

Takamichi Osumi (Fujitsu) <osumi.takamichi@fujitsu.com>

From: "osumi.takamichi@fujitsu.com" <osumi.takamichi@fujitsu.com>
To: 'Laurenz Albe' <laurenz.albe@cybertec.at>, Fujii Masao <masao.fujii@oss.nttdata.com>, 'Kyotaro Horiguchi' <horikyota.ntt@gmail.com>
Cc: "david@pgmasters.net" <david@pgmasters.net>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2021-04-04T03:07:16Z
Lists: pgsql-hackers
On  Friday, April 2, 2021 11:49 PM  Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> On Thu, 2021-04-01 at 17:25 +0900, Fujii Masao wrote:
> > Thanks for updating the patch!
> >
> > +                                errhint("Use a backup taken after
> setting wal_level to higher than minimal "
> > +                                                "or recover to the
> > + point in time before wal_level becomes minimal even though it causes
> > + data loss")));
> >
> > ISTM that "or recover to the point in time before wal_level was changed
> >   to minimal even though it may cause data loss" sounds better. Thought?
> 
> I would reduce it to
> 
> "Either use a later backup, or recover to a point in time before \"wal_level\"
> was set to \"minimal\"."
> 
> I'd say that we can leave it to the intelligence of the reader to deduce that
> recovering to an earlier time means more data loss.
Thank you. Yet, I prefer the longer version.
For example, the later backup can be another backup that fails during archive recovery
if the user have several backups during wal_level=replica
and it is taken before setting wal_level=minimal, right ?

Like this, giving much information is helpful for better decision taken by user, I thought.

Best Regards,
	Takamichi Osumi

Commits

  1. Fix test added by commit 9de9294b0c.

  2. Stop archive recovery if WAL generated with wal_level=minimal is found.