Re: Return pg_control from pg_backup_stop().

From: Andy Pogrebnoi <andrew(dot)pogrebnoi(at)percona(dot)com>
To: David Steele <david(at)pgbackrest(dot)org>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Haibo Yan <tristan(dot)yim(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Subject: Re: Return pg_control from pg_backup_stop().
Date: 2026-07-28 10:36:33
Message-ID: CA+aWR10d__mdN1pVbrCmmsSHG=0mur=fw9PBcL7k9bdoJ1qmKQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 18, 2026 at 2:27 PM David Steele <david(at)pgbackrest(dot)org> wrote:

> On 3/18/26 15:26, Michael Paquier wrote:
> > On Wed, Mar 18, 2026 at 07:35:47AM +0000, David Steele wrote:
> >> You are correct -- the copy of pg_control needs to happen before
> >> do_pg_backup_stop(). An older version of this patch saved pg_control in
> >> backup_state which made the prior location safe. However, I missed
> moving
> >> this code when I moved pg_control out of backup_state. Code review to
> the
> >> rescue.
> >
> > Right. I am wondering also if the final result would not be better
> > without 0002, actually, focusing only on the "simpler" base backup
> > case through the replication protocol, and you are making a good case
> > in mentioning it as not absolutely mandatory for base backups that are
> > taken through the SQL functions. One could always tweak the flag
> > manually in the control file based on the contents taken from the data
> > folder. That's more hairy than writing the entire file, for sure,
> > still possible.
>
> Getting even 01 into PG19 would be a great outcome. This would solve the
> problem of torn pg_control and deleted backup labels for any backups
> made with pg_basebackup and that's going to cover a *lot* of cases.
>
>
It'd be great to have 01 committed. It seems to me like a solid and low
cost solution for the torn pg_control (and missed backup lables). These are
good improvements for base backups.

I also reviewed the 01 patch but have nothing to add to the previous
reviewers; looks good to me.

---
Cheers,
Andy

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2026-07-28 10:44:50 RE: sequencesync worker race with REFRESH SEQUENCES
Previous Message Zsolt Parragi 2026-07-28 10:01:43 datachecksums: handle invalid and dropped databases during enable