I was trying to do Point in Time Restore, I had my placed by previously backed up WAL file in my directory to where my restore command
(/var/lib/postgresql/16/main/pg_wal/wal_archive) in postgres.conf points to, however my WAL files changes have not been applied:
listen_addresses = '*'
wal_level = replica
max_connections = 100
archive_mode = on
archive_command = 'test ! -f /var/lib/postgresql/16/main/pg_wal/wal_archive/%f && cp %p /var/lib/postgresql/16/main/pg_wal/wal_archive/%f'
restore_command = 'cp /var/lib/postgresql/16/main/pg_wal/wal_archive/%f %p'
#max_wal_senders = 10
#wal_log_hints = on
And I have created empty recovery.signal file, and here is logs from restarting
Postgres(my backed up file is named 000000010000000000000039):
2024-02-23 17:25:02.199 UTC LOG: starting PostgreSQL 16.2 (Debian 16.2-1.pgdg120+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-02-23 17:25:02.199 UTC LOG: listening on IPv4 address "0.0.0.0", port 5432
2024-02-23 17:25:02.199 UTC LOG: listening on IPv6 address "::", port 5432
2024-02-23 17:25:02.200 UTC LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-02-23 17:25:02.204 UTC LOG: database system was shut down at 2024-02-23 17:25:02 UTC
cp: cannot stat '/var/lib/postgresql/16/main/pg_wal/wal_archive/00000003.history': No such file or directory
2024-02-23 17:25:02.207 UTC LOG: starting archive recovery
2024-02-23 17:25:02.209 UTC LOG: restored log file "00000002.history" from archive
cp: cannot stat '/var/lib/postgresql/16/main/pg_wal/wal_archive/00000002000000000000003A': No such file or directory
2024-02-23 17:25:02.216 UTC LOG: consistent recovery state reached at 0/3A0000A0
2024-02-23 17:25:02.216 UTC LOG: invalid record length at 0/3A0000A0: expected at least 24, got 0
2024-02-23 17:25:02.216 UTC LOG: redo is not required
2024-02-23 17:25:02.217 UTC LOG: database system is ready to accept read-only connections
cp: cannot stat '/var/lib/postgresql/16/main/pg_wal/wal_archive/00000002000000000000003A': No such file or directory
cp: cannot stat '/var/lib/postgresql/16/main/pg_wal/wal_archive/00000003.history': No such file or directory
2024-02-23 17:25:02.223 UTC LOG: selected new timeline ID: 3
2024-02-23 17:25:02.263 UTC LOG: restored log file "00000002.history" from archive
2024-02-23 17:25:02.264 UTC LOG: archive recovery complete
2024-02-23 17:25:02.265 UTC LOG: checkpoint starting: end-of-recovery immediate wait
2024-02-23 17:25:02.270 UTC LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.002 s, sync=0.001 s, total=0.006 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB; lsn=0/3A0000A0, redo lsn=0/3A0000A0
2024-02-23 17:25:02.275 UTC LOG: database system is ready to accept connections
Asked by Руслан Пилипюк
(1 rep)
Feb 23, 2024, 05:41 PM
Last activity: Aug 4, 2025, 10:04 AM
Last activity: Aug 4, 2025, 10:04 AM