Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gw88M-0000XS-MI for pgsql-general@arkaria.postgresql.org; Tue, 19 Feb 2019 16:20:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gw88L-0004Lo-Ea for pgsql-general@arkaria.postgresql.org; Tue, 19 Feb 2019 16:20:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gw88L-0004LV-5u for pgsql-general@lists.postgresql.org; Tue, 19 Feb 2019 16:20:37 +0000 Received: from mail-it1-x143.google.com ([2607:f8b0:4864:20::143]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gw88I-00050o-Qi for pgsql-general@lists.postgresql.org; Tue, 19 Feb 2019 16:20:36 +0000 Received: by mail-it1-x143.google.com with SMTP id l66so7544716itg.3 for ; Tue, 19 Feb 2019 08:20:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:cc:in-reply-to:message-id:from:subject:to:date :references; bh=l2lmyEHOY22Y9kCk2KTpKUcEMqSol6/9wVtF25OgP5w=; b=s2ojH5kAIRu25EBJ4kmkVQ+0h53EN2EiEMpUO5hBmHbNORhKKgl7p+kYJpxWI3wAzo OiLnd03F1YcaI3MqGOdtNJs+FjyK+rB/q/NhjPjp8GRo/dXKQy3KgVsowQj0GiSxrcU2 buWb6tPhSYz8+GuQDLcByJeS0LVGKniJCBRJGo9LzXP1SZ2deIZg2zbwqRqrxSRQYu+l brMY5k2di8s/tTNfIEyfXewo0kCbMHA4Qs67oyXbIGQUkLUA+TvNI1rjW3CQRI28I+Lf gO0Llw2OgHxVfJzxEqbOlmrmqnj0gOX/lksQm/1YTHU7uQdBOmVb7XsJMNG4J1Zm6xLC voeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:cc:in-reply-to:message-id:from :subject:to:date:references; bh=l2lmyEHOY22Y9kCk2KTpKUcEMqSol6/9wVtF25OgP5w=; b=cbtzD/sbLcCafUs5wm/oj/QlRJcxYgM+33oP7qdDwQjfL+sCHvANMxyntaZl7RTxZ9 p3jIyvqOoYmbpqmiUIH4wWEcwpQ+ilrWStXEOsjR+Wc6ORxizowYbFCrZchmw3ehO5gI RIOW+H0xUPjDaY1+TBwlZCixUYD0I2RtmetAAOL2D7DQFnUq8W2nTp2MOC8FS83qjVtP vMA98aq86L3lG2lXniLn8tC6xQpepzKM4s8DsCSu3IIkLtgFi/+CLL6oKCabvXyeZ3JB JSrC8nj62tlNiX8jVPNU+Xj6GNjOZfVM+dsCWExbV74EbhEGjpYwRN+RTB/591O72Ovh c/lw== X-Gm-Message-State: AHQUAuZVk+mnodCpFyn7iKtB0MeIxbzcJeUhbN8P2ttLW/2ntYKHR1S/ Qzp9o+NLuLmvUn/CKIaDjnZztaQi X-Google-Smtp-Source: AHgI3IarLj9+zTFDlKS+cBiK3S9dsJ+HxYPscDbWASGCO7Q5n0UnSEAukjqb/iSam1T49PVuDXUOrw== X-Received: by 2002:a02:45d1:: with SMTP id o78mr5806983jad.126.1550593232719; Tue, 19 Feb 2019 08:20:32 -0800 (PST) Received: from localhost (166.193.193.35.bc.googleusercontent.com. [35.193.193.166]) by smtp.gmail.com with ESMTPSA id c14sm6031985iot.13.2019.02.19.08.20.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Feb 2019 08:20:32 -0800 (PST) Mime-Version: 1.0 Cc: "pgsql-generallists.postgresql.org" In-Reply-To: Message-ID: <5c6c2c3e3ec218380d000001@polymail.io> From: =?UTF-8?q?Mart=C3=ADn_Fern=C3=A1ndez?= X-Polymail-Id: <5c6c2c3e3ec218380d000001@polymail.io> Subject: Re: PG Upgrade with hardlinks, when to start/stop master and replicas To: "Hellmuth Vargas" , "Stephen Frost" Date: Tue, 19 Feb 2019 08:20:21 -0800 References: X-Mailer: Polymail Content-Type: multipart/alternative; boundary=f00b9c6fefcaa2edbd6278c0938bf7af81ef5e72e36c800d6bfc27c2b599 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --f00b9c6fefcaa2edbd6278c0938bf7af81ef5e72e36c800d6bfc27c2b599 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Stephen, Thanks for information! I've refactor our migration scripts to follow the s= uggestions.=C2=A0 One extra question that popped up. As long as we don't start the standby (a= fter running rsync), we can always `rm -f $PGDATA_10` and promote the stand= by if necessary for failover right ? We also need to `mv` pg_control.old to= pg_control in the old data directory. Thanks! Mart=C3=ADn On Tue, Feb 19th, 2019 at 12:39 PM, Hellmuth Vargas wrot= e: >=20 > Thank you=C2=A0Stephen=C2=A0=F0=9F=91=8D >=20 > El mar., 19 de feb. de 2019 a la(s) 10:05, Stephen Frost ( sfrost@snowman= .net > ) escribi=C3=B3: >=20 >=20 >> Greetings, >>=20 >> * Hellmuth Vargas ( hivs77@gmail.com ) wrote: >> > But could you do the following procedure?: >>=20 >> > pg_upgrade of the master >> > rysnc with a hot standby >>=20 >> The above should be alright provided both the primary and the standby >> are down and the instructions in the pg_upgrade docs are followed. >>=20 >> > arracar master >> > hot standby start >>=20 >> So, start both the primary and the replica?=C2=A0 That part should be fi= ne by >> itself. >>=20 >> > stop hot standby and rsync the other hot standby with the migrated hot >> > standby? >>=20 >> 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?=C2=A0 I don't see any obvious issue with that as the result shou= ld >> mean that the two replicas are identical from PG's perspective from that >> point moving forward. >>=20 >> Ultimately, it really depends on your specific environment though, of >> course.=C2=A0 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. >>=20 >> Thanks! >>=20 >> Stephen >>=20 >=20 >=20 >=20 >=20 >=20 > -- > Cordialmente, >=20 > Ing. Hellmuth I. Vargas S. > Esp. Telem=C3=A1tica y Negocios por Internet=C2=A0 > Oracle Database 10g Administrator Certified Associate > EnterpriseDB=C2=A0Certified=C2=A0PostgreSQL 9.3=C2=A0Associate >=20 >=20 > --f00b9c6fefcaa2edbd6278c0938bf7af81ef5e72e36c800d6bfc27c2b599 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8 3D""
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 i= f necessary for failover right ? We also need to `mv` pg_control.old to pg_= control in the old data directory.

Thanks!

Mart=C3=ADn

On Tue, Feb 19th, 2019 at 12:39 PM, Hellmuth Vargas= <hivs77@gmail.com> wrote:
Thank you Stephen =F0=9F=91=8D<= /div>

El mar., 19 de feb. de 2019 a la(s) 10:05,= Stephen Frost (sfrost@snowman.net) escribi=C3=B3:
Gree= tings,

* Hellmuth Vargas (hivs77@gmail.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<= br> 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=C3=A1tica y Negocios por Int= ernet 
Oracle Database 10g Administrator Certified Associate
EnterpriseDB Certified PostgreSQL 9.3 Associate


--f00b9c6fefcaa2edbd6278c0938bf7af81ef5e72e36c800d6bfc27c2b599--