Re: Using pg_upgrade on log-shipping standby servers

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
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-07-26 13:59:46
Message-ID: 1343311186.15907.10.camel@fsopti579.F-Secure.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On tor, 2012-07-26 at 08:30 -0400, Bruce Momjian wrote:
> On Mon, Jul 23, 2012 at 11:11:27PM +0300, Peter Eisentraut wrote:
> > On mån, 2012-07-23 at 10:08 -0400, Robert Haas wrote:
> > > Relying on the number of hard links seems very fragile. For example,
> > > it'll break if you are using copy mode. And it won't work on Windows,
> > > either.
> >
> > pg_upgrade could remember the list of files that the user would need to
> > copy to the remote server (i.e., the list of files pg_upgrade itself
> > copied or linked) and write that to a file.
>
> Good idea. A list of file names seems best, but wouldn't that list
> exceed the maximum size of an argument list? How could we pass that
> list to a command like scp?

xargs

> 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.

> 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.

> 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2012-07-26 14:15:27 Re: filenames in pg_basebackup
Previous Message Bruce Momjian 2012-07-26 13:23:57 Re: Using pg_upgrade on log-shipping standby servers