Re: New trigger option of pg_standby

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Guillaume Smet <guillaume(dot)smet(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New trigger option of pg_standby
Date: 2009-04-15 17:56:03
Message-ID: 1239818163.23905.55.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Wed, 2009-04-15 at 17:02 +0900, Fujii Masao wrote:

> On Tue, Apr 14, 2009 at 2:41 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> > I'd like to propose another simple idea; pg_standby deletes the
> > trigger file *whenever* the nextWALfile is a timeline history file.
> > A timeline history file is restored at the end of recovery, so it's
> > guaranteed that the trigger file is deleted whether nextWALfile
> > exists or not.
> >
> > A timeline history file is restored also at the beginning of
> > recovery, so the accidentally remaining trigger file is deleted
> > in early warm-standby as a side-effect of this idea.
>
> Here is the revised patch as above.
>
> If you notice something, please feel free to comment.

Deleting the trigger file when we request a history file works in most
cases, but not in all. We also request a history file when we switch
timelines, so code comments need slight modification.

If take a base backup, switchover and then try to regen the primary from
the base backup we would need to switch timelines, which could be
problematic. That is unlikely, so we should at least very clearly
document the actual behaviour, as we do in the code comments.

I think your wording that smart mode guarantees no data will be lost is
a little strong. I'd say "on successful completion all WAL records will
be replayed resulting in zero data loss".

--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2009-04-15 17:57:22 Re: Unicode string literals versus the world
Previous Message Greg Stark 2009-04-15 17:52:52 Re: Unicode string literals versus the world