I did a vacuum on the master server today and the read / slave fell behind.

When I check, that WAL file is in the pg_xlog directory on the slave and in the wal_archive directory which I created on the master.

Why is Postgres not "seeing" that WAL file.

(I saw an answer on Postgres requested WAL segment has already been removed (however it is actually in the slave's directory) however I'm not keen to copy the file into the pg_xlog of the master in case it causes an issue on the master.)

  • Are you sure it is the right file already in the replica's pg_xlog, and not just a "recycled ahead" file which has that name, but not the correct content? How did it get there? Is replication actually stalled? It might ask the master for the file (so that it has the most up-to-date possible version), and then go ahead and use the copy it already has instead once it gets the error. The error message will show up in the log, but it is not a permanent error.
    – jjanes
    Nov 26, 2019 at 18:33

1 Answer 1


Add a. restore_command that can restore the required WAL file from the archive to recovery.conf (or postgresql.conf from v12 on) and restart the standby.

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.