Wal standbies switchover

From: "Dimitri Gritsenko" <dev789(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Wal standbies switchover
Date: 2007-08-02 08:26:47
Message-ID: 79eb93740708020126i5ac550bdw7a42cec1930793e7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Goal - having 1 master and 2 standbies - make switchover in the way , that
except minimal downtime - there was always 1 running master and 2 warm
standbies.

Lets say i have 3 hosts (1,2,3) , 1 master and 2 warm standbies . ( M1 SB2
SB3)
Each SB gets (Master rsyncs from his side to SB) archived wal files from
master and recovers in continues way untill triggered to start as master.,
also it gets incomplete wals from pg_xlog dir .
Switchover looks for me like this.
1. M1 stops , all sync crons stopped.
2. Do last rsync of archived wals and pg_xlog to SB2 , SB3
3. SB2 triggered to start , it recovers last incomplete wals from pg_xlog
and starts (becomes M2), and starts cron rsync to SB3
4. SB3 does nothing , it continues get recover wal archives which now it
gets from M2. (Question - is it ok ? It looks like new archived wal files
from M2 should be valid without any changes)
5. What happens on host 1 (former master) is a question. It needs to become
a SB1 . Do i need to make large rsync of whole db from M2 (like during SB
install) or i can just keep old data and start db in recovery mode , getting
new wal files?

There is a difference between SB2 and new SB1. SB2 had data_dir -
corresponding to last recovered ARCHIVED file , and SB1 - to last INCOMPLETE
WAL files , so its not the same.

So , 2 questions on points 4 and 5.

Any comments?

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ralph Smith 2007-08-03 00:07:21 pg_catalog.pg_roles DESTROYED?
Previous Message David Bear 2007-08-02 05:11:01 incrementals with pg-dump