3

One of our ancient PostgreSQL server's used disk space has increased to 90%. First I've checked the archive command:

archive_command = 'rsync -aq %p /data/wal-archive/%f'

The problem with that command is rsync is not installed. So I've replaced it with:

archive_command = 'test ! -f /data/pgsql/data/mnt/server/archivedir/%f && 
    cp %p /data/pgsql/data/mnt/server/archivedir/%f'

After the replacement here is the output of postgresql.log:

cp: cannot stat `pg_xlog/000000010000000000000001': No such file or directory

I presume beginning of the pg_xlog files removed by hand. Do you have any idea how to make this archive process work?

1 Answer 1

3

First, take a pg_basebackup, just in case. Then set your archive command to /bin/true. That will allow Postgres to delete everything to its own satisfaction that has already been deleted. To restore from backup you need the WAL since your last basebackup. Restoring to a point in time before is now impossible I’m afraid. When this is finished, set the archive command correctly. And get some monitoring for this!

1
  • I've moved all of the .ready files to .done in the archive_status directory. All of the wal files removed. Archiving is now working properly i think. I didn't write this as a solution because i don't know the true effects of my actions.
    – Ozan Temel
    Commented May 11, 2018 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.