Re: Promotion of standby to master

From: Ben Chobot <bench(at)silentmedia(dot)com>
To: Andy Chambers <achambers(at)mcna(dot)net>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Promotion of standby to master
Date: 2012-06-29 22:12:12
Message-ID: 158F294F-43FA-41BF-9C56-19C38DAAEFC7@silentmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Jun 29, 2012, at 12:16 PM, Andy Chambers wrote:

> I understand that it's possible to promote a "hot standby" pg server
> simply by creating the failover file. In a scenario where there are
> multiple standby servers, is it possible to point the other standby
> servers to the new master without creating a new base backup?
>
> When I tried to do this, I ran into the "timeline 2 of the primary
> does not match recovery target timeline 1". I'm just trying to figure
> out if that's because the procedure I followed to promote the standby
> was wrong or because it's just not possible.

On your slaves, you need to have the line:

recovery_target_timeline=latest

This allows the slaves to notice that a new timeline has started and move to it. The one gotcha is that you have to make sure to promote a slave which is most ahead in terms of replication; otherwise, if you promote a slave which is further behind than another slave, and that could cause you grief when the lagging slave tries to replicate from the new master.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Misa Simic 2012-06-29 22:20:57 Re: LEFT and RIGHT JOIN
Previous Message Ben Madin 2012-06-29 22:10:49 Re: Catalog Bloat in Development - Frequently dropping/adding schemas and objects