I’ve been hacking on a tool to allow resynchronizing an old master server after failover. Please take a look: https://github.com/vmware/pg_rewind.
I’ve been hacking on a tool to allow resynchronizing an old master server after failover. Please take a look: https://github.com/vmware/pg_rewind.
Cool, Heikki.
After failing back, does the slave need to be recreated? Or does that depend on 9.4 timeline changes?
very userful, is there any plan for make pg_rewind compatible with 9.1/9.2 tree?
is there any plan for that?
No plans to do that. 9.3 made it easier to write tools like this, thanks to a patch by Andres Freund to split the WAL reading code into a separate file that can be used in external tools. For older versions, all that code would need to be copy-pasted and modified to work without all the backend infrastructure.
Also, Robert Haas pointed out a fairly serious flaw in pg_rewind: http://www.postgresql.org/message-id/CA+TgmoY4j+p7JY69ry8GpOSMMdZNYqU6dtiONPrcxaVG+SPByg@mail.gmail.com. Fortunately, that problem can be avoided by turning on page checksums, which forces full-page images to be written to WAL for hint bit updates. That makes pg_rewind safe again. But page checksums is a new feature in 9.3.