Re: Clarification in pg10's pgupgrade.html step 10 (upgrading standby servers)

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Andreas Joseph Krogh <andreas(at)visena(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Stephen Frost <sfrost(at)snowman(dot)net>
Subject: Re: Clarification in pg10's pgupgrade.html step 10 (upgrading standby servers)
Date: 2017-09-13 13:26:27
Message-ID: 20170913132627.GG6766@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 13, 2017 at 01:35:17AM +0200, Andreas Joseph Krogh wrote:
> På onsdag 13. september 2017 kl. 01:00:20, skrev Bruce Momjian <
> bruce(at)momjian(dot)us>:
> (I know this isn't exactly -hackers food, but it seems natural to end this
> thread here)
>  
> Ok, thanks.
> It is clearer what happens now that you've explained that there's a clever
> "rsync-trick" involving 2 directories and making rsync preserving
> hard-links that way on the destination-server. Maybe it's because I'm not a
> native English speaker but it wasn't obvious to me...
>  
> I have my tablespaces laid out like this:
> /storage/fast_ssd/9.6/tablespaces/<customer>
> which you correctly say that in practice means that 9.6 files are (I see now
> that I don't need the pg-version in my directory-structure):
> /storage/fast_ssd/9.6/tablespaces/<customer>/PG_9.6_201608131
>  
> I understand, I hope, that without link-mode rsyncing tablespaces would be like
> this:
> rsync --archive /path/to/tablespace_basedir standby:/path/to/tablespace_basedir
>  
> What would the equivalent be in link-mode, for transferring most efficiently?
> The reason I ask is that it's not immediately obvious to me what "old_datadir"
> and "new_datadir" when rsync'ing tablespaces and pg_wal dirs outside the
> "pg-dirs".
>  
> Speaking of pg_wal, how should this be rsynced now that it's changed its name
> (from pg_xlog), just rsync pg_xlog and rename it?
>  
> I know I'm being a little nitty-gritty here, but if it helps me understand it
> might help others.

I have applied the attached patch to show examples of using rsync on
PGDATA and tablespaces, documented that rsync is only useful when in
link mode, and explained more clearly how rsync handles links. You can
see the results here:

http://momjian.us/pgsql_docs/pgupgrade.html

Any more improvements?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +

Attachment Content-Type Size
diff text/plain 5.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-09-13 13:51:19 Re: Re: [COMMITTERS] pgsql: Use MINVALUE/MAXVALUE instead of UNBOUNDED for range partition b
Previous Message Tomas Vondra 2017-09-13 13:01:55 Re: Hooks to track changed pages for backup purposes