Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dsdVl-00011y-GV for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Sep 2017 23:25:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dsdVl-0001bg-1Z for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Sep 2017 23:25:33 +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 1dsdUC-00078H-3V for pgsql-hackers@postgresql.org; Thu, 14 Sep 2017 23:23:56 +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 1dsdU8-0004Ci-Oj for pgsql-hackers@postgresql.org; Thu, 14 Sep 2017 23:23:55 +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=YoHs82nIMGSzy43jAT1kHpy2sHUkgAPAlsq/5GYRN7Y=; b=PmTCJilrJvbd0N8n8FMQftoOXJtLJ8ibscjxh/hDZAIttRAJ+fOHB2D53ik2yTwphRtV+Nh6s3MF0jhpHhwDjAEnOp1SfYBevYBHKKDdYNoebAShAS9czl/MvxQtZkRvA/URgWRJ2FboC3I9MkiqSLeKKsVobfCHZgA10Yi+PUM=; 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 1dsdU4-0001e8-6E; Fri, 15 Sep 2017 01:23:50 +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 1dsdU1-0008Op-7G; Fri, 15 Sep 2017 01:23:45 +0200 Date: Fri, 15 Sep 2017 01:23:45 +0200 (CEST) From: Andreas Joseph Krogh To: Bruce Momjian Cc: Michael Paquier , Robert Haas , "pgsql-hackers@postgresql.org" , Stephen Frost Message-ID: In-Reply-To: <20170914191356.GC6595@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_1022_1199313535.1505431425101" 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_1020_291648953.1505431425090 Content-Type: multipart/related; boundary="----=_Part_1021_1005499634.1505431425090" ------=_Part_1021_1005499634.1505431425090 Content-Type: multipart/alternative; boundary="----=_Part_1022_1199313535.1505431425101" ------=_Part_1022_1199313535.1505431425101 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable P=C3=A5 torsdag 14. september 2017 kl. 21:13:56, skrev Bruce Momjian < bruce@momjian.us >: On Thu, Sep 14, 2017 at 08:49:24PM +0200, Andreas Joseph Krogh wrote: >=C2=A0 =C2=A0 =C2=A0I think the tablespace example is clear enough to mod= ify for WAL and we >=C2=A0 =C2=A0 =C2=A0instruct them right below that example to do WAL. > > =C2=A0 > Well, it's not following the exact same structure as there's no > "version-directory" in pg_xlog, so the "rsync the version-dirs into it's= =20 parent > on the target"=C2=A0isn't what's happening. > =C2=A0 > That's why I think this makes sense to mention for the sake of a complet= e > example: > > rsync --archive --delete --hard-links --size-only=20 /vol1/postgres/9.6/pg_xlog \ >=C2=A0 =C2=A0 =C2=A0 =C2=A0/vol1/postgres/10/pg_wal standby.example.com:/= vol1/postgres/10/pg_wal Well, there is technically no need for version directories in pgdata either --- installers just create them. =C2=A0 =C2=A0 I tested upgrading from 9.6 to 10=C2=A0now, using pg_upgrade, and pg_upgrad= e=20 creates the new data-dir with pg_wal "in it" (just like regular initdb), so= =20 pg_upgrade seems not to care about where the old version's pg_xlog was. You= =20 have to move (by symlinking)=C2=A0pg_wal to a separate location manually *a= fter*=20 running pg_upgrade on the master. No special handling is needed when rsync'= ing=20 it over to the standby, so it doesn't need any=C2=A0--hard-links or --size-= only,=20 correct? =C2=A0 Given the path,=C2=A0on the upgraded primary,=C2=A0to=C2=A0pg_wal=C2=A0is= =C2=A0/custom/path/to/pg_wal,=20 the rsync command will be: =C2=A0 rsync --archive --delete /custom/path/to/pg_wal=20 standby.example.com:/custom/path/to/pg_wal =C2=A0 I think it's useful to mention this to eliminate any doubt. =C2=A0 I also think it's worth mentioning that you have to manually move pg_wal to= a=20 custom location after running pg_upgrade as it will not preserve/use the ol= d=20 path. =C2=A0 Thanks. -- Andreas Joseph Krogh ------=_Part_1022_1199313535.1505431425101 Content-Type: text/html;charset=UTF-8 Content-Transfer-Encoding: quoted-printable
P=C3=A5 torsdag 14. september 2017 kl. 21:13:56, skrev Bruce Momjian &= lt;bruce@momjian.us>:
On = Thu, Sep 14, 2017 at 08:49:24PM +0200, Andreas Joseph Krogh wrote:
>=C2=A0 =C2=A0 =C2=A0I think the tablespace example is clear enough to m= odify for WAL and we
>=C2=A0 =C2=A0 =C2=A0instruct them right below that example to do WAL. >
> =C2=A0
> Well, it's not following the exact same structure as there's no
> "version-directory" in pg_xlog, so the "rsync the versi= on-dirs into it's parent
> on the target"=C2=A0isn't what's happening.
> =C2=A0
> That's why I think this makes sense to mention for the sake of a compl= ete
> example:
>
> rsync --archive --delete --hard-links --size-only /vol1/postgres/9.6/p= g_xlog \
>=C2=A0 =C2=A0 =C2=A0 =C2=A0/vol1/postgres/10/pg_wal standby.example.com= :/vol1/postgres/10/pg_wal

Well, there is technically no need for version directories in pgdata
either --- installers just create them.
=C2=A0
=C2=A0
I tested upgrading from 9.6 to 10=C2=A0now, using pg_upgrade, and pg_u= pgrade creates the new data-dir with pg_wal "in it" (just like re= gular initdb), so pg_upgrade seems not to care about where the old version'= s pg_xlog was. You have to move (by symlinking)=C2=A0pg_wal to a separate l= ocation manually *after* running pg_upgrade on the master. No special handl= ing is needed when rsync'ing it over to the standby, so it doesn't need any= =C2=A0--hard-links or --size-only, correct?
=C2=A0
Given the path,=C2=A0on the upgraded primary,=C2=A0to=C2=A0pg_wal=C2= =A0is=C2=A0/custom/path/to/pg_wal, the rsync command will be:
=C2=A0
rsync --archive --delete /cust= om/path/to/pg_wal standby.example.com:/custom/path/to/pg_wal
=C2=A0
I think it's useful to mention this to eliminate any doubt.
=C2=A0
I also think it's worth mentioning that you have to manually move pg_w= al to a custom location after running pg_upgrade as it will not preserve/us= e the old path.
=C2=A0
Thanks.

--
Andreas Joseph Krogh
------=_Part_1022_1199313535.1505431425101-- ------=_Part_1021_1005499634.1505431425090-- ------=_Part_1020_291648953.1505431425090--