Re: Stronger safeguard for archive recovery not to miss data

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: masao(dot)fujii(at)oss(dot)nttdata(dot)com
Cc: david(at)pgmasters(dot)net, osumi(dot)takamichi(at)fujitsu(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org, laurenz(dot)albe(at)cybertec(dot)at
Subject: Re: Stronger safeguard for archive recovery not to miss data
Date: 2021-03-31 06:05:35
Message-ID: 20210331.150535.843142143018772306.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Wed, 31 Mar 2021 15:03:28 +0900 (JST), Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> wrote in
> At Wed, 31 Mar 2021 02:11:48 +0900, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> wrote in
> > > So, I would revert all the changes in xlog.c except changing the
> > > warning to an error:
> > > -        ereport(WARNING,
> > > -                (errmsg("WAL was generated with wal_level=minimal,
> > > -data may be missing"),
> > > -                 errhint("This happens if you temporarily set
> > > -wal_level=minimal without taking a new base backup.")));
> > > +            ereport(FATAL,
> > > +                    (errmsg("WAL was generated with
> > > wal_level=minimal, cannot continue recovering"),
> > > +                     errdetail("This happens if you temporarily set
> > > wal_level=minimal on the server."),
> > > +                     errhint("Run recovery again from a new base
> > > backup taken after setting wal_level higher than minimal")));
> > I guess that users usually encounter this error because they have not
> > taken base backups yet after setting wal_level to higher than minimal
> > and have to use the old base backup for archive recovery. So I'm not
> > sure
> > how much only this HINT is helpful for them. Isn't it better to append
> > something like "If there is no such backup, recover to the point in
> > time
> > before wal_level is set to minimal even though which cause data loss,
> > to start the server." into HINT?
>
> I agree that the hint doesn't make sense.

For the primary case,

> HINT: Restart with archive recovery turned off. The past backups are no longer usable. You need to take a new one after restart.
>
> If it's the replica case, it would be..
>
> HINT: Start from a fresh standby created from the curent primary server.

Start from a fresh backup...

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-03-31 06:14:06 Re: making update/delete of inheritance trees scale better
Previous Message Kyotaro Horiguchi 2021-03-31 06:03:28 Re: Stronger safeguard for archive recovery not to miss data