Point-In-Time Recovery issue - Timeline file lost

From: Carlos Augusto Ferreira de Oliveira <caugustofo(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Point-In-Time Recovery issue - Timeline file lost
Date: 2024-01-08 11:23:59
Message-ID: CAOZyD7UP-NbpkM7ukcXtOr-5E5Ur7WA5M8yufUMJ_vwr0JyS+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello everyone,

My team and I have a situation and would like to know if anyone is going
through something similar.

We have several RedHat 9 virtual servers, running PostgreSQL version 14.10.

Our backup tool is Veritas Netbackup 10.1.1 WebUI.

We needed to perform a PIT Recovery last week (on a recovery server) and,
when doing so, we came across the following error:

2024-01-05 12:19:30.085 -03 [300359] LOG: database system was interrupted;
last known up at 2023-12-29 23:30:50 -03
cp: cannot stat '/path/to/file/00000002.history': No such file or directory
2024-01-05 12:19:30.468 -03 [300359] LOG: starting point-in-time recovery
to WAL location (LSN) "7D2/15FFFEB8"
2024-01-05 12:19:30.468 -03 [300359] LOG: invalid primary checkpoint record
2024-01-05 12:19:30.468 -03 [300359] PANIC: could not locate a valid
checkpoint record

We found a web page that gave us an idea

http://www.sixfortwo.com/2015/09/just-quick-one-while-hes-away.html

However, when trying to reproduce it, it didn't work.
We have the wal files archived on an NFS share, but we don't understand
when we should create the timeline file. We have some questions:

1 - Should it be created at the time the base was interrupted?
2 - Should it be created based on the time of the last file archived?
3 - Is there any way to recreate a valid timeline file from the archived
wal files?
4 - Is there any more specific documentation that guides how to recreate a
timeline file?

Browse pgsql-general by date

  From Date Subject
Next Message David Gauthier 2024-01-08 16:26:57 How to \ef a function ?
Previous Message Innocent Ememe 2024-01-08 08:23:12 Unable to install postgresql and pgadmin