Postgresql – Slony Replication: Will data eventually be 100% replicated if daemon dies for long period

postgresqlslony

I am using Slony to replicate a Postgres database.

If my slony daemon exits for whatever reason, and doesn't start up hypothetically until 1 month later, will all the data that has accumulated in the master be replicated eventually to the slave? Of course, it might take a long time for that to happen, but will any data be lost as a result?

Best Answer

This is a fairly expert-level question and I could be wrong, but I think you are going to have a lot of issues in the scenario you suggest.

The basic issue is that while Slony is designed to handle periods of inactivity, you have a lot of stuff that is going to be queued for replication. If you make any DDL queries in the mean time, those can't get queued, and slonyk will not work to replicate them, so you will have a significant number of problems here.

My recommendation is not to use Slony for things where you expect long periods of inactivity (say, more than a couple of days). The limitations you will run into keeping this running are significant.

So yes, your data will eventually get replicated, maybe.... It depends on whether other problems surface in the mean time. I wouldn't recommend it in that case.