Re: Using pg_upgrade on log-shipping standby servers

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, 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-27 12:24:54
Message-ID: CA+Tgmoa=7v1wf6SbAdgpuUR1-hYp22N55nmmvrA0XJ-fgL0gNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 26, 2012 at 2:17 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
> On Thu, Jul 26, 2012 at 01:24:19PM -0400, Robert Haas wrote:
>> On Thu, Jul 26, 2012 at 12:06 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>> > I don't see the "don't modify the user files" behavior changing anytime
>> > soon, and it is documented, so I feel pretty confident that those files
>> > were not modified on the primary or standby cluster, and are hence the
>> > same, or at least as "the same" as they were when they were running the
>> > older major version of Postgres.
>> >
>> > Is that sufficient?
>>
>> Well, at the very least, you need to guarantee that the standby is
>> caught up - i.e. that it replayed all the WAL records that were
>> generated on the master before it was shut down for the final time. I
>> don't think that telling the user that they must be sure to do that is
>> sufficient - you need some kind of built-in safeguard that will
>> complain loudly if it's not the case.
>
> Yes, that would be a problem because the WAL records are deleted by
> pg_upgrade. Does a shutdown of the standby not already replay all WAL
> logs?

Not if it's an immediate shutdown, and not if it didn't have them all
on disk in the first place. Who is to say it's even caught up?

> I was originally thinking that we would require users to run pg_upgrade
> on the standby, where you need to first switch into master mode.

As Jeff says, that doesn't help anything.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-07-27 12:29:20 Re: Using pg_upgrade on log-shipping standby servers
Previous Message Tom Lane 2012-07-27 05:49:28 Re: proposal - assign result of query to psql variable