Re: pg_upgrade and rsync

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>, Josh Berkus <josh(at)agliodbs(dot)com>
Subject: Re: pg_upgrade and rsync
Date: 2015-01-23 18:57:51
Message-ID: 20150123185751.GO11664@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-01-23 13:52:54 -0500, Stephen Frost wrote:
> * Andres Freund (andres(at)2ndquadrant(dot)com) wrote:
> > On 2015-01-22 20:54:47 -0500, Stephen Frost wrote:
> > > * Bruce Momjian (bruce(at)momjian(dot)us) wrote:
> > > > On Fri, Jan 23, 2015 at 01:19:33AM +0100, Andres Freund wrote:
> > > > > Or do you - as the text edited in your patch, but not the quote above -
> > > > > mean to run pg_upgrade just on the primary and then rsync?
> > > >
> > > > No, I was going to run it on both, then rsync.
> > >
> > > I'm pretty sure this is all a lot easier than you believe it to be. If
> > > you want to recreate what pg_upgrade does to a cluster then the simplest
> > > thing to do is rsync before removing any of the hard links. rsync will
> > > simply recreate the same hard link tree that pg_upgrade created when it
> > > ran, and update files which were actually changed (the catalog tables).
> >
> > I don't understand why that'd be better than simply fixing (yes, that's
> > imo the correct term) pg_upgrade to retain relfilenodes across the
> > upgrade. Afaics there's no conflict risk and it'd make the clusters much
> > more similar, which would be good; independent of rsyncing standbys.
>
> That's an entirely orthogonal discussion from the original one though,
> no?

Don't think so.

> That wouldn't actually help with what Bruce is trying to do, which
> is to duplicate the results of the pg_upgrade from the master over to
> the standby.

Well, it'd pretty much obliviate the need to run pg_upgrade on the
standby. As there's no renamed files you don't need to muck around with
leaving hardlinks in place and such just so that rsync recognizes
unchanged files.

> Trying to pg_upgrade both the master and the standby, to me at least,
> seems like an even *worse* approach than trusting rsync with -H and
> --size-only..

I think running pg_upgrade on the standby is a dangerous folly.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2015-01-23 19:01:34 Re: basebackups during ALTER DATABASE ... SET TABLESPACE ... not safe?
Previous Message Joshua D. Drake 2015-01-23 18:54:45 Re: Parallel Seq Scan