Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drqP4-0003Ue-2E for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Sep 2017 18:59:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1drqP3-0000pB-8c for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Sep 2017 18:59:21 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1drqP2-0000p2-MR for pgsql-hackers@postgresql.org; Tue, 12 Sep 2017 18:59:20 +0000 Received: from post.visena.com ([46.226.10.50]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1drqOu-0006th-9s for pgsql-hackers@postgresql.org; Tue, 12 Sep 2017 18:59:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=visena.com; s=20141101.wh; h=Content-Type:MIME-Version:Subject:In-Reply-To:Message-ID:Cc:To:From:Date; bh=7rcvO8gsp8TZdgQD4hWjLs1UmRvtBtVD67uXQwe0kjw=; b=QFqpdxsFukGXAWMyYB1p7NO3TjLgFKX1fD1IYDDKQmH0Wmb91opO4abCqHWLaiVG0IjEETQMhEsTakH2zCcOUupipmqafBLNudtOrOQovzlstxqUvVBUlk1LCHYwnEJCDvaa0tT8VNndQg5UjTsYaxwXkGZ5Oyv6b/SNsc/TfKU=; Received: from [10.0.1.10] (helo=tc7-visena.wh.internal.visena.com) by post.visena.com with esmtp (Exim 4.82) (envelope-from ) id 1drqOq-0001X7-1U; Tue, 12 Sep 2017 20:59:10 +0200 Received: from localhost ([127.0.0.1] helo=tc7-visena.wh.internal.visena.com) by tc7-visena.wh.internal.visena.com with esmtp (Exim 4.86_2) (envelope-from ) id 1drqOn-0006Ic-PA; Tue, 12 Sep 2017 20:59:05 +0200 Date: Tue, 12 Sep 2017 20:59:05 +0200 (CEST) From: Andreas Joseph Krogh To: Bruce Momjian Cc: Michael Paquier , Robert Haas , "pgsql-hackers@postgresql.org" Message-ID: In-Reply-To: <20170912171922.GA3705@momjian.us> Subject: Re: Clarification in pg10's pgupgrade.html step 10 (upgrading standby servers) MIME-Version: 1.0 X-Mailer: Visena Mail 2.1.0-SNAPSHOT X-Spam-Score: -1.0 X-Spam-Report: SpamAssasin (score=-1.0, required 5.0 ALL_TRUSTED=-1,HTML_MESSAGE=0.001) Content-Type: multipart/alternative; boundary="----=_Part_442_17225077.1505242745653" List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org ------=_Part_440_2037296846.1505242745623 Content-Type: multipart/related; boundary="----=_Part_441_1847304949.1505242745624" ------=_Part_441_1847304949.1505242745624 Content-Type: multipart/alternative; boundary="----=_Part_442_17225077.1505242745653" ------=_Part_442_17225077.1505242745653 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable P=C3=A5 tirsdag 12. september 2017 kl. 19:19:22, skrev Bruce Momjian < bruce@momjian.us >: On Thu, Aug=C2=A0 3, 2017 at 11:37:32AM +0200, Michael Paquier wrote: > On Mon, Jul 31, 2017 at 6:13 PM, Robert Haas wro= te: > > On Fri, Jul 28, 2017 at 10:35 AM, Andreas Joseph Krogh > > wrote: > >> I'm reading https://www.postgresql.org/docs/10/static/pgupgrade.html = to=20 try > >> to understand how to upgrade standby-servers using pg_upgrade with pg= 10. > >> > >> The text in step 10 sais: > >> "You will not be running pg_upgrade on the standby servers, but rathe= r > >> rsync", which to me sounds like rsync, in step 10-f, should be issued= on=20 the > >> standy servers. Is this the case? If so I don't understand how the=20 standby's > >> data is upgraded and what "remote_dir" is. If rsync is supposed to be= =20 issued > >> on the primary then I think it should be explicitly mentioned, and st= ep=20 10-f > >> should provide a clarer example with more detailed values for the > >> directory-structures involved. > >> > >> I really think section 10 needs improvement as I'm certainly not=20 comfortable > >> upgrading standbys following the existing procedure. > > > > Yeah, I don't understand it either, and I have never been convinced > > that there's any safe way to do it other than recloning the standbys > > from the upgraded master. > > Here are my 2c on the matter. 10-f means that the upgraded node may > have generated WAL with wal_level =3D minimal, which, at least it seems > to me, that we have a risk of having inconsistent data pages if only a > rsync is used on the old standbys. Like Robert, the flow we used in > the products I work on is to re-create standbys from scratch after the > upgrade using a fresh backup, with a VM cloning. An upgrade here is an > in-place process not only linked to Postgres, so standby VMs are made > of many services, some are being linked to Postgres. So this choice is > mainly decided by those dependencies, still it feels safer anyway. I have applied the attached doc patch back to 9.5 to clarify pg_upgrade's rsync instructions and explain how it works. Improvements? =C2=A0 =C2=A0 Thanks, that certainly improves things. But; I still find the rsync-command in f) confusing; 1. Why=C2=A0--size-only? From rsync manual: "skip files that match in size"= , is=20 this safe?? 2. Why is old_pgdata in the rsync-command, why is it needed to sync it? =C2=A0 There are many ways to do/configure things it seems, resulting in many ifs = and=20 buts which makes section 10 rather confusing. I really think a complete=20 example, with absolute paths, would be clarifying. =C2=A0 I'm afraid many will still re-create standbys from scratch without a really= =20 good and complete example to follow. -- Andreas Joseph Krogh ------=_Part_442_17225077.1505242745653 Content-Type: text/html;charset=UTF-8 Content-Transfer-Encoding: quoted-printable
P=C3=A5 tirsdag 12. september 2017 kl. 19:19:22, skrev Bruce Momjian &= lt;bruce@momjian.us>:
On = Thu, Aug=C2=A0 3, 2017 at 11:37:32AM +0200, Michael Paquier wrote:
> On Mon, Jul 31, 2017 at 6:13 PM, Robert Haas <robertmhaas@gmail.com= > wrote:
> > On Fri, Jul 28, 2017 at 10:35 AM, Andreas Joseph Krogh
> > <andreas@visena.com> wrote:
> >> I'm reading https://www.postgresql.org/docs/10/static/pgupgra= de.html to try
> >> to understand how to upgrade standby-servers using pg_upgrade= with pg10.
> >>
> >> The text in step 10 sais:
> >> "You will not be running pg_upgrade on the standby serve= rs, but rather
> >> rsync", which to me sounds like rsync, in step 10-f, sho= uld be issued on the
> >> standy servers. Is this the case? If so I don't understand ho= w the standby's
> >> data is upgraded and what "remote_dir" is. If rsync= is supposed to be issued
> >> on the primary then I think it should be explicitly mentioned= , and step 10-f
> >> should provide a clarer example with more detailed values for= the
> >> directory-structures involved.
> >>
> >> I really think section 10 needs improvement as I'm certainly = not comfortable
> >> upgrading standbys following the existing procedure.
> >
> > Yeah, I don't understand it either, and I have never been convinc= ed
> > that there's any safe way to do it other than recloning the stand= bys
> > from the upgraded master.
>
> Here are my 2c on the matter. 10-f means that the upgraded node may > have generated WAL with wal_level =3D minimal, which, at least it seem= s
> to me, that we have a risk of having inconsistent data pages if only a=
> rsync is used on the old standbys. Like Robert, the flow we used in > the products I work on is to re-create standbys from scratch after the=
> upgrade using a fresh backup, with a VM cloning. An upgrade here is an=
> in-place process not only linked to Postgres, so standby VMs are made<= br> > of many services, some are being linked to Postgres. So this choice is=
> mainly decided by those dependencies, still it feels safer anyway.

I have applied the attached doc patch back to 9.5 to clarify
pg_upgrade's rsync instructions and explain how it works.

Improvements?
=C2=A0
=C2=A0
Thanks, that certainly improves things.
But; I still find the rsync-command in f) confusing;
1. Why=C2=A0--size-only? From rsync manual: "skip files that matc= h in size", is this safe??
2. Why is old_pgdata in the rsync-command, why is it needed to sync it= ?
=C2=A0
There are many ways to do/configure things it seems, resulting in many= ifs and buts which makes section 10 rather confusing. I really think a com= plete example, with absolute paths, would be clarifying.
=C2=A0
I'm afraid many will still re-create standbys from scratch without a r= eally good and complete example to follow.

--
Andreas Joseph Krogh
------=_Part_442_17225077.1505242745653-- ------=_Part_441_1847304949.1505242745624-- ------=_Part_440_2037296846.1505242745623--