Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YvTHo-0000SD-4x for pgsql-committers@arkaria.postgresql.org; Thu, 21 May 2015 16:25:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YvTHn-0002Q6-3g for pgsql-committers@arkaria.postgresql.org; Thu, 21 May 2015 16:25:31 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YvTHd-00029t-MK for pgsql-committers@postgresql.org; Thu, 21 May 2015 16:25:21 +0000 Received: from mail-pa0-f46.google.com ([209.85.220.46]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YvTHa-0000lz-81 for pgsql-committers@postgresql.org; Thu, 21 May 2015 16:25:20 +0000 Received: by pabts4 with SMTP id ts4so110326862pab.3 for ; Thu, 21 May 2015 09:25:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=/T6IF0Yw8GvxdTpTsVrX3xKB0ONGMDwAgoijyGtgYxk=; b=SnDhDMhg2nv8HmvxFI8LPrgmUR1+QwA1NNZLBLdmOwRxiJNrs2Ej9VQZeK+GMOpoHk 3Dvrq4eYJjQDEgpvigi7dcK1k9ir+0B9sdcaryCpqtCLTzbiI/bVxVIApaA1hgNs8Q0p chWxcxgTFWOjahNwSwpk7FfciC4gyF+RdEDzZotmLoKh6RYU4JCyv1vNXqqHzAJ7SkOr R3Wz5hitfrHhJ1pMvDIPCFIpL2b5L/Qjl1cF6k2cdAaQbbPSb0uP3vxW2XeASsaMH5qq gcIwi3RVA5RPE4Q5ublnAikS37mJJQJEbWcGJmUvlakL0bBocq1Z97fs8tgWx9ar1Fip KgUA== X-Gm-Message-State: ALoCoQnQhK0Iwr0ocRrHue3f0G0+QWd45HgWEmw7mM64BR6cPWASiLCv0WfsrjGx0W+77So5WFkC MIME-Version: 1.0 X-Received: by 10.70.33.200 with SMTP id t8mr7069183pdi.15.1432225517122; Thu, 21 May 2015 09:25:17 -0700 (PDT) Received: by 10.70.53.33 with HTTP; Thu, 21 May 2015 09:25:16 -0700 (PDT) In-Reply-To: References: Date: Thu, 21 May 2015 12:25:16 -0400 Message-ID: Subject: Re: pgsql: Make recovery_target_action = pause work. From: Simon Riggs To: Fujii Masao Cc: pgsql-committers Content-Type: multipart/alternative; boundary=047d7bd90aee2fd2d4051699fd4c X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org --047d7bd90aee2fd2d4051699fd4c Content-Type: text/plain; charset=UTF-8 On 21 May 2015 at 00:57, Fujii Masao wrote: > Make recovery_target_action = pause work. > > Previously even if recovery_target_action was set to pause and > the recovery target was reached, the recovery could never be paused. > Because the setting of pause was *always* overridden with that of > shutdown unexpectedly. This override is valid and intentional > if hot_standby is not enabled because there is no way to resume > the paused recovery in this case and the setting of pause is > completely useless. But not if hot_standby is enabled. > > This patch changes the code so that the setting of pause is overridden > with that of shutdown only when hot_standby is not enabled. > > Bug reported by Andres Freund > Note for archives: this is a bug, not a change in behaviour. The original coding of standbyState == STANDBY_DISABLED wasn't correct because standbyState > STANDBY_DISABLED only after we run InitRecoveryTransactionEnvironment() which happens later than this parameter check. -- Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --047d7bd90aee2fd2d4051699fd4c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 21 May 2015 at 00:57, Fujii Masao <= ;fujii@postgresql= .org> wrote:
Make recovery_target_action =3D pause work.

Previously even if recovery_target_action was set to pause and
the recovery target was reached, the recovery could never be paused.
Because the setting of pause was *always* overridden with that of
shutdown unexpectedly. This override is valid and intentional
if hot_standby is not enabled because there is no way to resume
the paused recovery in this case and the setting of pause is
completely useless. But not if hot_standby is enabled.

This patch changes the code so that the setting of pause is overridden
with that of shutdown only when hot_standby is not enabled.

Bug reported by Andres Freund

Note for = archives: this is a bug, not a change in behaviour.

The original coding of=C2=A0standbyState=C2=A0=3D=3D=C2=A0ST= ANDBY_DISABLED
wasn't correct because standbyState >= ; STANDBY_DISABLED only after we run InitRecoveryTransactionEnvironment() w= hich happens later than this parameter check.=C2=A0

--
Simon Riggs =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0=C2=A0=C2=A0http://www.2ndQuadrant.com/
Pos= tgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--047d7bd90aee2fd2d4051699fd4c--