Postgres restart in the middle of exclusive backup and the presence of backup_label file

From: SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Postgres restart in the middle of exclusive backup and the presence of backup_label file
Date: 2021-11-24 22:12:19
Message-ID: CAHg+QDfiM+WU61tF6=nPZocMZvHDzCK47Kneyb0ZRULYzV5sKQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hackers,

While an exclusive backup is in progress if Postgres restarts, postgres
runs the recovery from the checkpoint identified by the label file instead
of the control file. This can cause long recovery or even sometimes fail to
recover as the WAL records corresponding to that checkpoint location are
removed. I can write a layer in my control plane to remove the backup_label
file when I know the server is not in restore from the base backup but I
don't see a reason why everyone has to repeat this step. Am I missing
something?

If there are no standby.signal or recovery.signal, what is the use case of
honoring backup_label file? Even when they exist, for a long running
recovery, should we honor the backup_label file as the majority of the WAL
already applied? It does slow down the recovery on restart right as it has
to start all the way from the beginning?

Thanks,
Satya

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-11-24 22:16:50 Re: internal subtransactions, memory contexts, resource owners
Previous Message Melanie Plageman 2021-11-24 21:19:20 Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)