K
K
Kenny002021-05-04 14:04:52
linux
Kenny00, 2021-05-04 14:04:52

How to correctly start the postgresql database after completely deleting the wal directory?

I did something stupid, now the database does not start:

< 2021-04-27 23:59:48.130 MSK >ОШИБКА:  запрошенный сегмент WAL 0000000100000007000000A1 уже удалён
< 2021-04-27 23:59:53.136 MSK >ОШИБКА:  запрошенный сегмент WAL 0000000100000007000000A1 уже удалён
< 2021-04-27 23:59:58.140 MSK >ОШИБКА:  запрошенный сегмент WAL 0000000100000007000000A1 уже удалён
< 2021-05-04 13:06:12.899 MSK >СООБЩЕНИЕ:  система БД была выключена: 2021-04-30 17:47:05 MSK
< 2021-05-04 13:06:12.920 MSK >СООБЩЕНИЕ:  неверная запись первичной контрольной точки
< 2021-05-04 13:06:12.934 MSK >СООБЩЕНИЕ:  неверная запись вторичной контрольной точки
< 2021-05-04 13:06:12.934 MSK >ПАНИКА:  не удалось считать правильную запись контрольной точки
< 2021-05-04 13:06:12.935 MSK >СООБЩЕНИЕ:  стартовый процесс (PID 32168) был завершён по сигналу 6: Aborted

I decided to remove the replication slot from an unused application, since a lot of wal files have accumulated.
Deleted the slot, but the files remained. I stopped the cluster normally.
Then I manually cleaned the /var/lib/postgresql/10/ut/pg_wal
folder to zero. Of course, I did not make copies of the database in the hope that during the stop everything from wal was written to the database.

Can you tell me how to fix the base? And how it was necessary to do it wisely if the shafts from the slot are not removed when the slot is removed.

Distributor ID: Debian
Description:    Debian GNU/Linux 9.13 (stretch)
Release:        9.13
Codename:       stretch

PostgreSQL 10.5 (Ubuntu 10.5-24.1C) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609, 64-bit

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RazdoR, 2021-05-04
@Kenny00

pg_resetwal is your choice

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question