Re: PostgreSQL Failback without rebuild

From: James Sewell <james(dot)sewell(at)lisasoft(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL Failback without rebuild
Date: 2014-02-07 06:02:44
Message-ID: CANkGpBuEfp=3D+3duKPJM7NnRy7t9nM9u71qce7FcB7b==mcpw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Node A could get ahead even if it has been shut down cleanly BEFORE the
promotion?

I'd always assumed if I shut down the master the slave would be at the same
point after shutdown - is this incorrect?

Cheers,

James Sewell,
PostgreSQL Team Lead / Solutions Architect
______________________________________

Level 2, 50 Queen St, Melbourne VIC 3000

*P *(+61) 3 8370 8000 *W* www.lisasoft.com *F *(+61) 3 8370 8099

On Fri, Feb 7, 2014 at 4:58 PM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com>wrote:

>
>
>
> On Fri, Feb 7, 2014 at 1:57 PM, James Sewell <james(dot)sewell(at)lisasoft(dot)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
>

--

------------------------------
The contents of this email are confidential and may be subject to legal or
professional privilege and copyright. No representation is made that this
email is free of viruses or other defects. If you have received this
communication in error, you may not copy or distribute any part of it or
otherwise disclose its contents to anyone. Please advise the sender of your
incorrect receipt of this correspondence.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2014-02-07 06:15:22 Typo in a comment?
Previous Message Michael Paquier 2014-02-07 05:58:25 Re: PostgreSQL Failback without rebuild