Demoting master to slave without an rsync...is it safe?

From: Chris Redekop <chris(at)replicon(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Demoting master to slave without an rsync...is it safe?
Date: 2011-09-06 15:05:51
Message-ID: CAC2SuRKRJB6p1=MpSdifqLX5axWMw1Y8QFHTXKfr9u2E5npv4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a master+slave set up using asynchronous streaming replication. If I
do a graceful (-fast) shutdown of the master, and then promote the slave to
master, my understanding is that I should not have any data loss. At that
point in order to bring the old master back up as a slave the docs say I
should do a base-backup etc....however I've found that simply
setting recovery_target_timeline='latest' does allow the old master to start
back up as a slave, and everything appears to be happy, all data seems to be
synced properly. My question is, is this safe to do? It's a very
attractive option as it removes a significant amount of load from the master
server for planned switch-overs (maintenance/upgrades/whatever). Thanks!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2011-09-06 15:10:54 Re: Query runs in 335ms; function in 100,239ms : date problem?
Previous Message David Johnston 2011-09-06 14:18:41 Re: UPDATE using query; per-row function calling problem