Re: PG Upgrade with hardlinks, when to start/stop master and replicas

From: Martín Fernández <fmartin91(at)gmail(dot)com>
To: "Hellmuth Vargas" <hivs77(at)gmail(dot)com>, "Stephen Frost" <sfrost(at)snowman(dot)net>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: PG Upgrade with hardlinks, when to start/stop master and replicas
Date: 2019-02-19 16:20:21
Message-ID: 5c6c2c3e3ec218380d000001@polymail.io
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stephen,

Thanks for information! I've refactor our migration scripts to follow the suggestions. 

One extra question that popped up. As long as we don't start the standby (after running rsync), we can always `rm -f $PGDATA_10` and promote the standby if necessary for failover right ? We also need to `mv` pg_control.old to pg_control in the old data directory.

Thanks!

Martín

On Tue, Feb 19th, 2019 at 12:39 PM, Hellmuth Vargas <hivs77(at)gmail(dot)com> wrote:

>
> Thank you Stephen 👍
>
> El mar., 19 de feb. de 2019 a la(s) 10:05, Stephen Frost ( sfrost(at)snowman(dot)net
> ) escribió:
>
>
>> Greetings,
>>
>> * Hellmuth Vargas ( hivs77(at)gmail(dot)com ) wrote:
>> > But could you do the following procedure?:
>>
>> > pg_upgrade of the master
>> > rysnc with a hot standby
>>
>> The above should be alright provided both the primary and the standby
>> are down and the instructions in the pg_upgrade docs are followed.
>>
>> > arracar master
>> > hot standby start
>>
>> So, start both the primary and the replica?  That part should be fine by
>> itself.
>>
>> > stop hot standby and rsync the other hot standby with the migrated hot
>> > standby?
>>
>> At some later point, shut down the replica completely, then do an rsync
>> from that replica to the other replica and build its hard-link tree that
>> way, and update anything that's changed while the 'migrated' replica was
>> online?  I don't see any obvious issue with that as the result should
>> mean that the two replicas are identical from PG's perspective from that
>> point moving forward.
>>
>> Ultimately, it really depends on your specific environment though, of
>> course.  It also might not be a bad idea to do a regular backup of the
>> upgraded primary and then restore that to the second replica, just to
>> make sure you have that whole process working and to test out your
>> restore process.
>>
>> Thanks!
>>
>> Stephen
>>
>
>
>
>
>
> --
> Cordialmente,
>
> Ing. Hellmuth I. Vargas S.
> Esp. Telemática y Negocios por Internet 
> Oracle Database 10g Administrator Certified Associate
> EnterpriseDB Certified PostgreSQL 9.3 Associate
>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2019-02-19 16:37:06 Re: PG Upgrade with hardlinks, when to start/stop master and replicas
Previous Message Hellmuth Vargas 2019-02-19 15:39:10 Re: PG Upgrade with hardlinks, when to start/stop master and replicas