[Pgpool-general] How to obtain a synchronized pg_xlog dir?

Alessandro Candini candini at meeo.it
Wed Nov 24 16:23:10 UTC 2010


Hi. I'm always dealing with pgpool-II-3.0.1 and postgres-9.0.1 in
hot-standby/streaming replication...

I realized that when I try a failback of an ex primary as standby, it fails
because I have different WALs inside the pg_xlog directory.
For example in current primary, ex standby, I have:
pg_xlog/00000008.history
pg_xlog/00000009.history
pg_xlog/000000070000000000000025
pg_xlog/000000070000000000000026
pg_xlog/000000080000000000000026
pg_xlog/000000090000000000000026
pg_xlog/000000090000000000000027
pg_xlog/000000090000000000000028
pg_xlog/archive_status/00000008.history.ready
pg_xlog/archive_status/00000009.history.ready

In ex primary, now supposed to be the standby I have only:
pg_xlog/000000090000000000000027
pg_xlog/000000090000000000000028
pg_xlog/000000090000000000000029
pg_xlog/00000009000000000000002A

With this situation tha failback fails and postgresql log reports:
LOG:  entering standby mode
LOG:  streaming replication successfully connected to primary
LOG:  redo starts at 0/27000020
LOG:  consistent recovery state reached at 0/28000000
FATAL:  the database system is starting up
FATAL:  the database system is starting up
FATAL:  the database system is starting up
...

But if I shut down the servers and perform another manual sync from the current
primary, ex standby:
rsync -av /home/database/9.0.1/data/pg_xlog/
${currentStandbyIP}:/home/database/9.0.1/data/pg_xlog
and I restart the servers, the switch between them works immediately...

But how can automatize this? It seems that during basebackup.sh execution, other
WALs are producted and so my rsync inside it does not copy everything...

How can I solve this?

Thanks in advance!



More information about the Pgpool-general mailing list