Re: How to upgrade from 9.1 to 9.2 with replication?

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: sthomas(at)optionshouse(dot)com
Cc: Kevin Grittner <kgrittn(at)mail(dot)com>, Karl Denninger <karl(at)denninger(dot)net>, delongboy <sdelong(at)saucontech(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: How to upgrade from 9.1 to 9.2 with replication?
Date: 2012-10-25 14:27:51
Message-ID: CAGTBQpYcbPnT2UYj3i_o6nMYuGNN-xY1fJeQ3AXEetCDt1cfQA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Oct 25, 2012 at 9:47 AM, Shaun Thomas <sthomas(at)optionshouse(dot)com> wrote:
>> ... as long as the rsync was bracketed by calls to pg_start_backup()
>> and pg_stop_backup().
>
>
> Or they took it during a filesystem snapshot, or shut the database down.
>
> I thought that the only thing start/stop backup did was mark the beginning
> and end transaction logs for the duration of the backup so they could be
> backed up separately for a minimal replay.
>
> An rsync doesn't need that, because it's binary compatible. You get two
> exact copies of the database, provided data wasn't changing. That's easy
> enough to accomplish, really.
... as long as the rsync was bracketed by calls to pg_start_backup()
and pg_stop_backup().

Or they took it during a filesystem snapshot, or shut the database down.

I thought that the only thing start/stop backup did was mark the
beginning and end transaction logs for the duration of the backup so
they could be backed up separately for a minimal replay.

An rsync doesn't need that, because it's binary compatible. You get
two exact copies of the database, provided data wasn't changing.
That's easy enough to accomplish, really.
Well, that's the thing. Without pg_start_backup, the database is
changing and rsync will not make a perfect copy. With pg_start_backup,
the replica will replay the WAL from the start_backup point, and any
difference rsync left will be ironed out.

That's why I say:

rsync - the first one takes a long time
start backup
rsync - this one will take a lot less
stop backup

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Jeff Janes 2012-10-25 16:20:56 Re: Query-Planer from 6seconds TO DAYS
Previous Message delongboy 2012-10-25 14:12:04 Re: How to upgrade from 9.1 to 9.2 with replication?