Re: Replication/cloning: rsync vs modification dates? - Mailing list pgsql-general

From Bruce Momjian
Subject Re: Replication/cloning: rsync vs modification dates?
Date
Msg-id 20120728215435.GC10876@momjian.us
Whole thread Raw
In response to Re: Replication/cloning: rsync vs modification dates?  (Chris Angelico <rosuav@gmail.com>)
List pgsql-general
On Fri, Jul 27, 2012 at 02:13:31PM +1000, Chris Angelico wrote:
> On Fri, Jul 27, 2012 at 9:57 AM, Chris Angelico <rosuav@gmail.com> wrote:
> > On Fri, Jul 27, 2012 at 9:53 AM, Bruce Momjian <bruce@momjian.us> wrote:
> >> You might want to look at the hackers list thread I started about the
> >> same topic a week before your post:
> >>
> >>         http://archives.postgresql.org/pgsql-hackers/2012-07/msg00416.php
> >>
> >> Basically, you can only use mtime/size if you are replaying WAL.
> >
> > I'll check that out in a bit; but hot standby includes replaying WAL,
> > right? That's what we're doing - full live replication with
> > possibility to "pg_ctl promote" a slave straight up to master.
>
> Hi, thanks for that link. Just got a chance to read through the thread.
>
> In this post[1] the script executes "checkpoint" before
> "pg_start_backup" - is that important? According to the docs[2]:
>
> "There is an optional second parameter of type boolean. If true, it
> specifies executing pg_start_backup as quickly as possible. This
> forces an immediate checkpoint which will cause a spike in I/O
> operations, slowing any concurrently executing queries."

A checkpoint is always issued by pg_start_backup().  The boolean
controls whether the checkpoint is immediate or smoothed, meaning it can
take a while to return a status of complete.

> Is "checkpoint; select pg_start_backup('foo');" the same as "select
> pg_start_backup('foo',true);"? And what are the consequences of not
> calling for a checkpoint that way? My understanding of the docs is
> that the pg_start_backup call will hang until a checkpoint happens
> organically, ie delaying the backup rather than other clients, but I'm
> not really sure and haven't a sample database big or busy enough to
> test this on.

Right, checkpoint is started by pg_start_backup() but is smoothed by
default.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

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

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Trim not working (PostgreSQL 9.1.2 on Win64)
Next
From: Edson Richter
Date:
Subject: Re: Trim not working (PostgreSQL 9.1.2 on Win64)