Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Postgres 9.1.6 on Ubuntu and I have streaming replication setup between a master and slave. Everything has been running smoothly until the database crashed and we had to restart both of the boxes.

Now, replication has stopped and when checking the logs on both boxes, I see this message:

CDT FATAL: requested WAL segment 0000000100000224000000FA has already been removed

It's the same segment over and over again. From my Googling, it would seem that the replication server is trying to retrieve this segment from the master, but it's not there anymore. Ok, but how to get around this? Do I need to make a fresh backup and rsync that over to the slave? Is there an easy way to get the slave back in sync?

share|improve this question

migrated from Nov 2 '12 at 16:50

This question came from our site for professional and enthusiast programmers.

Yes you will have to give the slave a new base backup (for streaming replication only steps 1 to 4) of the master.

Your problem has probably occured because the value of wal_keep_segments is to low. The value needs to be high enough that when the slave is down for some time the master won't start recycling segments the slave hasn't processed yet.

share|improve this answer

Please verify that the required WALs are in the location from which you are restoring for initial restoration before connecting the slave to primary host in streaming mode

Your problem can happen when a WAL segment doe snot exist in the location from which you are restoring for initial recovery.

If everything is fine in this instance, then you shoudl check the restore_command in recovery.conf.

share|improve this answer

another work around is to do wal backup_push from primary and immediately do a backip_fetch from standby slave and start the standby.

share|improve this answer
Please expand on why this process works – RolandoMySQLDBA Dec 11 '15 at 22:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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