Re: Using pg_upgrade on log-shipping standby servers

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Aidan Van Dyk <aidan(at)highrise(dot)ca>, Jeff Davis <pgsql(at)j-davis(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Using pg_upgrade on log-shipping standby servers
Date: 2012-08-31 04:09:54
Message-ID: 20120831040954.GL32350@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 26, 2012 at 10:36:59AM -0400, Bruce Momjian wrote:
> > > Pg_upgrade already creates a script to analyze the cluster, so we could
> > > create another script to upgrade a standby. However, the problem with a
> > > script is that I have no idea what command people would use to do the
> > > copy.
> >
> > Exactly. Perhaps an example wouldn't hurt, but I wouldn't go too far.
>
> Agreed.
>
> > > I think I could create a list and pass that into a loop so only
> > > the command has to be modified, but again, how do we do that on Windows?
> > > Can we create a shell function in Windows and pass the file name as an
> > > argument?
> >
> > I don't know, but I assume that somewhere in the known universe there is
> > a way on Windows to say, here is a list of files, copy them to that
> > host.
>
> No idea.
>
> > > Another problem is that the standby cluster might create _new_ files
> > > that don't exist on the master, e.g. WAL files, and those have to be
> > > removed. I am not clear how to do that either, except by removing all
> > > files with a hard link count of 1, and again, this is difficult on
> > > Windows.
> >
> > Well, then that would call for another list of files.
>
> Well, not really. If we create a list of all user table/index files,
> then any file not on the list would be removed on the standby, then all
> the files in the primary not on the list are copied to the standby.
> One list is less error-prone. This is easy in Unix shell and Perl, but
> hard on Windows without Perl.

There was too much concern about pg_upgrade upgrading a standby server
that I am not going to peruse the issue at this time.

I did add a TODO in case we ever want to resurrect the idea:

Consider a way to run pg_upgrade on standby servers

http://archives.postgresql.org/pgsql-hackers/2012-07/msg00453.php

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

+ It's impossible for everything to be true. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kohei KaiGai 2012-08-31 04:27:34 Re: ALTER command reworks
Previous Message Bruce Momjian 2012-08-31 03:22:42 Re: has_language_privilege returns incorrect answer for non-superuser