Postgresql requested starting point is ahead of the WAL flush position of this server


I recently did a move of a VM and didn't pay close enough attention.

The VM container the postgres master. Some time passed between the backup and the move and now I'm getting stuff like this:

ERROR:  requested starting point 14C/93000000 is ahead of the WAL flush position of this server 14C/524BE2E0

The problem is going to be the fact that the slave received more WAL archives in between the time of the backup and the move.

The problem is: how do I fix it?

I've already done a new basebackup, cleaned wal archives with archivecleaner, but restarted the slave just keeps it coming back.

Sounds like slave WAL is ahead of master.

What's the solution here? I can't find it on google. Is there a way to reset this wal flush position? To tell the server to start anew?

EDIT: I ended up fixing it by deleting the slave and redeploying it, having it take the new basebackup as starting point.

Best Answer

I ended up deleting the slave and redeploying a new one with the "new" basebackup.

Obviously this is not ideal, but it works. It's a last resort solution. It's literally setting up that part of the environment fresh.