Re: PostgreSQL Failback without rebuild - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: PostgreSQL Failback without rebuild
Date
Msg-id CAB7nPqS4oqwCu_R+-RR58wQ4cG9Mu-xuHOZ7DurQarut68vbZg@mail.gmail.com
Whole thread Raw
In response to Re: PostgreSQL Failback without rebuild  (James Sewell <james.sewell@lisasoft.com>)
Responses Re: PostgreSQL Failback without rebuild  (James Sewell <james.sewell@lisasoft.com>)
List pgsql-hackers



On Fri, Feb 7, 2014 at 1:57 PM, James Sewell <james.sewell@lisasoft.com> wrote:
I've just noticed that on PostgreSQL 9.3 I can do the following with a master node A and a slave node B (as long as I have set recovery_target_timeline = 'latest'):
  1. Stop Node A
  2. Promote Node B
  3. Attach Node A as slave
This is sufficient for my needs (I know it doesn't cover a crash), can anyone see any potential problems with this approach?
Yes, node A could get ahead of the point where WAL forked when promoting B. In this case you cannot reconnect A to B, and need to actually recreate a node from a fresh base backup, or rewind it. pg_rewind targets the latter, postgres core is able to to the former, and depending on things like your environment and/or the size of your server, you might prefer one or the other.
Regards,
--
Michael

pgsql-hackers by date:

Previous
From: Hiroshi Inoue
Date:
Subject: Re: narwhal and PGDLLIMPORT
Next
From: James Sewell
Date:
Subject: Re: PostgreSQL Failback without rebuild