Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id CDD4263298F for ; Thu, 9 Apr 2009 09:47:58 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 28824-04 for ; Thu, 9 Apr 2009 09:47:48 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og102.obsmtp.com (exprod7og102.obsmtp.com [64.18.2.157]) by mail.postgresql.org (Postfix) with SMTP id 5E3D2632216 for ; Thu, 9 Apr 2009 09:47:56 -0300 (ADT) Received: from source ([209.85.146.178]) by exprod7ob102.postini.com ([64.18.6.12]) with SMTP ID DSNKSd3ueo94S5ncKS1Dc8gmF6y9SgAZbFjD@postini.com; Thu, 09 Apr 2009 05:47:55 PDT Received: by wa-out-1112.google.com with SMTP id v27so285230wah.22 for ; Thu, 09 Apr 2009 05:47:53 -0700 (PDT) Received: by 10.114.103.1 with SMTP id a1mr1375565wac.218.1239281273923; Thu, 09 Apr 2009 05:47:53 -0700 (PDT) Received: from ?80.223.212.7? (dsl-hkibrasgw2-fed4df00-7.dhcp.inet.fi [80.223.212.7]) by mx.google.com with ESMTPS id l37sm122557waf.38.2009.04.09.05.47.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 09 Apr 2009 05:47:52 -0700 (PDT) Message-ID: <49DDEE72.6030803@enterprisedb.com> Date: Thu, 09 Apr 2009 15:47:46 +0300 From: Heikki Linnakangas Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Fujii Masao CC: Guillaume Smet , Simon Riggs , Tom Lane , Peter Eisentraut , Kevin Grittner , pgsql-hackers Subject: Re: New trigger option of pg_standby References: <3f0b79eb0903242329j12865d55s348f5c873a956e71@mail.gmail.com> <3f0b79eb0903251851v5936d6b4x49997ac8f04b98b9@mail.gmail.com> <1d4e0c10903260032v767da1fdg6cf7cea86c64cc45@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> In-Reply-To: <3f0b79eb0904071817u5c32254ei61f7e68e54669d9e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200904/505 X-Sequence-Number: 136608 Fujii Masao wrote: > Hi, > > On Wed, Apr 8, 2009 at 6:56 AM, Guillaume Smet wrote: >> On Fri, Apr 3, 2009 at 5:42 AM, Fujii Masao wrote: >>> Here is the patch; >>> - Smart failover is chosen if the trigger file labeled "smart" or >>> an empty one exists. >>> - Fast failover is chosen if the trigger file labeled "fast" exists, >>> the signal (SIGUSR1 or SIGINT) is received or the wait timeout >>> happens. >> After some further thoughts, +1 for this approach too. >> >> I think you imply 'containing "smart"' not 'labeled "smart"'. >> "Labeled" is confusing IMHO. > > Thanks for the comment! > I corrected such confusing expression. > + if (strspn(buf, "smart") == 5 && strncmp(buf, "smart", 5) == 0) > + { The strspn() call seems pointless here. 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. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com