WAL shipping replication server re-sync - Mailing list pgsql-general

From Bosco Rama
Subject WAL shipping replication server re-sync
Date
Msg-id 4D852D8E.3020901@boscorama.com
Whole thread Raw
Responses Re: WAL shipping replication server re-sync  (Bruce Momjian <bruce@momjian.us>)
Re: WAL shipping replication server re-sync  (Bruce Momjian <bruce@momjian.us>)
List pgsql-general
Hey folks,

We're using PG 8.4.7 on two servers that are geographically
distant from each other.  We run WAL-shipping replication
(i.e. constant recovery mode replication) between the two
servers.  These are the only two servers involved in the
setup.  When we do the 'fail-over' to swap the master and
slave servers we perform the usual recovery trigger for
pg_standby and then wait.  The slave now becomes the master
and the master becomes the new slave.  This works great.

When the servers flip modes we have been following the
guidelines that say to clear the WAL logs and the main data
area of the slave and copy the data area of the new master
to the slave while the master is in 'backup' mode.  Given
the current size (17GB) of this data area and the bandwidth
limits of the 'inter-tubes', this takes a rather long time.
(4.5 hrs last time)

Here's my (naive?) question:  Since the two servers were
essentially 'in sync' immediately prior to the switch-
over is it possible to simply rsync the new master's data area
back to the new slave's data area without clearing the slave's
data area first?  Or is the directory and file structure
sufficiently different (even if the logical data is identical)
to preclude this?

Could this difference be alleviated by using the various 'delete
on destination' options for rsync?

TIA,
Bosco.

pgsql-general by date:

Previous
From: Vibhor Kumar
Date:
Subject: Re: How do I do this in plpgsql ?
Next
From: runner
Date:
Subject: How do you stop the log from rotating on restart?