Re: pg_upgrade and rsync

From: David Steele <david(at)pgmasters(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_upgrade and rsync
Date: 2015-01-29 23:39:23
Message-ID: 54CAC4AB.5060407@pgmasters.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/29/15 11:34 AM, Bruce Momjian wrote:

> 3. Check that the replica is not very lagged. If it is, wait for
> traffic to die down and for it to catch up.

I think I'd want a something a bit more specific here. When the primary
shuts down it will kick out one last WAL. The filename should be recorded.

> 7. shut down postgres on the replica.

Before the shutdown make sure that the replicas are waiting on the
subsequent log file to appear (note that versions prior to 9.3 skip
00). That means all WAL has been consumed and the primary and
replica(s) are in the same state.

This is a bit more complex if streaming replication is being used
*without* good old fashioned log shipping to a backup server and I'm not
sure exactly how to go about it. I suppose you could start Postgres in
single user mode, commit a transaction, and make sure that transaction
gets to the replicas.

OTOH, streaming replication (unless it is synchronous) would be crazy
without doing WAL backup. Maybe that's just me.

-- - David Steele david(at)pgmasters(dot)net

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2015-01-29 23:44:07 Re: TABLESAMPLE patch
Previous Message Peter Geoghegan 2015-01-29 23:38:46 Re: INSERT ... ON CONFLICT {UPDATE | IGNORE} 2.0