pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Simon Riggs <simon@2ndQuadrant.com>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Guillaume Smet <guillaume.smet@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: New trigger option of pg_standby
Date: Fri, 10 Apr 2009 17:31:43 +0100
Message-ID: <1239381103.16396.30.camel@ebony.2ndQuadrant> (raw)
In-Reply-To: <3f0b79eb0904092047w355e0b3ar527a9285b161ef91@mail.gmail.com>
References: <3f0b79eb0903242329j12865d55s348f5c873a956e71@mail.gmail.com>
	<1238064633.16568.420.camel@ebony.2ndQuadrant>
	<49CCBEE0.1080307@gmx.net>
	<8365.1238163943@sss.pgh.pa.us>
	<1238164596.16568.604.camel@ebony.2ndQuadrant>
	<3f0b79eb0903311901h70520cc8u9c0f1d8f4193923b@mail.gmail.com>
	<3f0b79eb0904022042g35b8e3cah9432ff764e721a3@mail.gmail.com>
	<1d4e0c10904071456m735e3f67q123b87243d2f6f2a@mail.gmail.com>
	<3f0b79eb0904071817u5c32254ei61f7e68e54669d9e@mail.gmail.com>
	<49DDEE72.6030803@enterprisedb.com>
	<3f0b79eb0904092047w355e0b3ar527a9285b161ef91@mail.gmail.com>


Fujii-san,

I like the new patch using the content of the file to determine the
mode. Much easier to use at failover time.

On Fri, 2009-04-10 at 12:47 +0900, Fujii Masao wrote:

> > One problem with this patch is that in smart mode, the trigger file is not
> > deleted. That's different from current pg_standby behavior, and makes
> > accidental failovers after one failover more likely.
> 
> Yes, it's because pg_standby cannot be sure when the trigger file
> can be removed in smart mode. If the trigger file is deleted as soon
> as it's found, just like in fast mode, pg_standby may keep waiting
> for WAL file again.

My understanding of smart mode is fairly simple: 

   if (triggered)
   {
	if (smartMode && nextWALfile+1 exists)
		exit(0);
	else
	{
		delete trigger file
		exit(1);
	}
   }

If you perform a file lookahead (the +1) as shown above then you avoid
the problem Heikki observes.

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




view thread (127+ messages)  latest in thread

Message-ID: <1239381103.16396.30.camel@ebony.2ndQuadrant>
Permalink:  ../1239381103.16396.30.camel@ebony.2ndQuadrant/
Also on:    postgresql.org/message-id/1239381103.16396.30.camel@ebony.2ndQuadrant

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: simon@2ndQuadrant.com, masao.fujii@gmail.com, heikki.linnakangas@enterprisedb.com, guillaume.smet@gmail.com, tgl@sss.pgh.pa.us, peter_e@gmx.net, Kevin.Grittner@wicourts.gov
  Subject: Re: New trigger option of pg_standby
  In-Reply-To: <1239381103.16396.30.camel@ebony.2ndQuadrant>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox