@igortru

Почему возникает ошибка при восстановлении PiTR Postgres WAL-G?

Привет.

Пытаюсь смоделировать ситуацию восстановления БД на определенный момент времени.

[root@test-db log]# /usr/local/bin/wal-g --config=/mnt/pg-data/.walg.json backup-list
name                          last_modified        wal_segment_backup_start
base_000000180000000000000057 2023-06-13T17:00:05Z 000000180000000000000057
base_000000180000000000000059 2023-06-14T17:00:04Z 000000180000000000000059
base_00000018000000000000005B 2023-06-15T17:00:05Z 00000018000000000000005B


Делаю восстановление из бекапа base_000000180000000000000057

/usr/local/bin/wal-g --config=/mnt/pg-data/.walg.json backup-fetch /mnt/pg-data/14 base_000000180000000000000057


postgresql.conf указываю следующее
recovery_target = ''
recovery_target_lsn = ''
recovery_target_name = ''
recovery_target_time = ''
#recovery_target_timeline = ''
recovery_target_xid = ''
restore_command = 'wal-g --config=/mnt/pg-data/.walg.json wal-fetch \"%f\" \"%p\" >> /var/log/wal-g/wal_g_restore_command.log 2>&1'
recovery_target_time = '2023-06-13 17:30:00'


При запуске Postgres получаю ошибку:
2023-06-16 13:31:03.820 GMT [14644] LOG:  starting PostgreSQL 14.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
2023-06-16 13:31:03.820 GMT [14644] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2023-06-16 13:31:03.820 GMT [14644] LOG:  listening on IPv6 address "::", port 5432
2023-06-16 13:31:03.822 GMT [14644] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-06-16 13:31:03.823 GMT [14644] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
2023-06-16 13:31:03.826 GMT [14647] LOG:  database system was interrupted; last known up at 2023-06-13 17:00:03 GMT
2023-06-16 13:31:03.984 GMT [14647] LOG:  restored log file "00000019.history" from archive
2023-06-16 13:31:04.183 GMT [14647] LOG:  starting point-in-time recovery to 2023-06-13 17:30:00+00
2023-06-16 13:31:04.301 GMT [14647] LOG:  restored log file "00000019.history" from archive
2023-06-16 13:31:04.433 GMT [14647] LOG:  restored log file "000000180000000000000057" from archive
2023-06-16 13:31:04.576 GMT [14647] LOG:  restored log file "00000018.history" from archive
2023-06-16 13:31:04.614 GMT [14647] LOG:  redo starts at 0/57000028
2023-06-16 13:31:04.615 GMT [14647] LOG:  consistent recovery state reached at 0/57000100
2023-06-16 13:31:04.616 GMT [14644] LOG:  database system is ready to accept read-only connections
2023-06-16 13:31:04.638 GMT [14647] LOG:  restored log file "000000180000000000000058" from archive
2023-06-16 13:31:04.661 GMT [14647] LOG:  restored log file "000000180000000000000059" from archive
2023-06-16 13:31:04.686 GMT [14647] LOG:  restored log file "00000018000000000000005A" from archive
2023-06-16 13:31:04.732 GMT [14647] LOG:  restored log file "00000018000000000000005B" from archive
2023-06-16 13:31:04.931 GMT [14647] LOG:  restored log file "00000019000000000000005C" from archive
2023-06-16 13:31:05.106 GMT [14647] LOG:  redo done at 0/5C0000D8 system usage: CPU: user: 0.00 s, system: 0.01 s, elapsed: 0.49 s
2023-06-16 13:31:05.106 GMT [14647] FATAL:  recovery ended before configured recovery target was reached
2023-06-16 13:31:05.107 GMT [14644] LOG:  startup process (PID 14647) exited with exit code 1
2023-06-16 13:31:05.107 GMT [14644] LOG:  terminating any other active server processes
2023-06-16 13:31:05.108 GMT [14644] LOG:  shutting down due to startup process failure
2023-06-16 13:31:05.112 GMT [14644] LOG:  database system is shut down


Пробовал в различных вариациях - другой бекап, другое время. Ошибка.

Что не так?
  • Вопрос задан
  • 377 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы