Re: [HACKERS] Clarification in pg10's pgupgrade.htmlstep 10 (upgrading standby servers) - Mailing list pgsql-hackers

From Andreas Joseph Krogh
Subject Re: [HACKERS] Clarification in pg10's pgupgrade.htmlstep 10 (upgrading standby servers)
Date
Msg-id VisenaEmail.6b.4b17ca3ad0960052.15e782a53d1@tc7-visena
Whole thread Raw
In response to Re: [HACKERS] Clarification in pg10's pgupgrade.html step 10(upgrading standby servers)  (Bruce Momjian <bruce@momjian.us>)
Responses Re: [HACKERS] Clarification in pg10's pgupgrade.htmlstep 10 (upgrading standby servers)
List pgsql-hackers
På tirsdag 12. september 2017 kl. 23:52:02, skrev Bruce Momjian <bruce@momjian.us>:
On Tue, Sep 12, 2017 at 08:59:05PM +0200, Andreas Joseph Krogh wrote:
>     Improvements?
>
> Thanks, that certainly improves things.
> But; I still find the rsync-command in f) confusing;
> 1. Why --size-only? From rsync manual: "skip files that match in size", is this
> safe??


> 2. Why is old_pgdata in the rsync-command, why is it needed to sync it?

If the file exists under the same name, it doesn't need to be checked at
all --- it is the same.  We don't want to check the file modification
time because it will probably be different because of replay delay or
clock drift.  We could use checksums, but there is no need since there is
no way the file contents could be different.
 
 
So you're saying that if the file exists (has the same name) on the standby (in old_pgdata), and has the same size, then you're safe that it contains the same data, hence --size-only?
Does this apply when not using --link mode for pg_upgrade?
 
 
> 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 complete
> example, with absolute paths, would be clarifying.

You mean a full rsync command, e.g.:

  rsync --archive --delete --hard-links --size-only \
      /opt/PostgreSQL/9.5 /opt/PostgreSQL/9.6 standby:/opt/PostgreSQL

Does that help?
 
 
It seems some non-obvious assumptions (to me at least) are made here.
This example seems only valid when using pg_upgrade --link, correct? If so it would be clearer to the reader if explicitly stated.
 
1. Why do you have to rsync both /opt/PostgreSQL/9.5 AND /opt/PostgreSQL/9.6, wouldn't /opt/PostgreSQL/9.6 suffice? Or does this assume "pg_upgrade --link" AND "rsync --hard-links" and therefore it somewhat needs to transfer less data?
2. What would the rsync command look like if pg_upgrade wasn't issued with --link?
3. What if the directory-layout isn't the same on primary and standby, ie. tablespaces are located differently?
 
Thanks.
 
--
Andreas Joseph Krogh
 

pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: [HACKERS] Patches that don't apply or don't compile: 2017-09-12
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Clarification in pg10's pgupgrade.htmlstep 10 (upgrading standby servers)