Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ljEBD-0002da-Kx for pgsql-hackers@arkaria.postgresql.org; Wed, 19 May 2021 04:51:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ljEBC-0002Nu-Ku for pgsql-hackers@arkaria.postgresql.org; Wed, 19 May 2021 04:51:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ljEBC-0002Nm-Cl for pgsql-hackers@lists.postgresql.org; Wed, 19 May 2021 04:51:34 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ljEBA-0003U0-1a for pgsql-hackers@postgresql.org; Wed, 19 May 2021 04:51:33 +0000 Received: from hnk.local (sp49-98-213-158.msd.spmode.ne.jp [49.98.213.158]) by oss.nttdata.com (Postfix) with ESMTPSA id 94A936181B; Wed, 19 May 2021 13:51:28 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.2 at oss.nttdata.com Subject: Re: pg_get_wal_replay_pause_state() should not return 'paused' while a promotion is ongoing. To: Kyotaro Horiguchi Cc: pgsql-hackers@postgresql.org References: <20210518.095805.1634592437754592061.horikyota.ntt@gmail.com> <20210519.095308.1406400973910988323.horikyota.ntt@gmail.com> From: Fujii Masao Message-ID: <7713989e-add9-b2ca-8804-236fc924f283@oss.nttdata.com> Date: Wed, 19 May 2021 13:51:28 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210519.095308.1406400973910988323.horikyota.ntt@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/05/19 9:53, Kyotaro Horiguchi wrote: > At Tue, 18 May 2021 12:48:38 +0900, Fujii Masao wrote in >> Currently a promotion causes all available WAL to be replayed before >> a standby becomes a primary whether it was in paused state or not. >> OTOH, something like immediate promotion (i.e., standby becomes >> a primary without replaying outstanding WAL) might be useful for >> some cases. I don't object to that. > > Mmm. I was confused with recovery target + pause. Actually promotion > works as so and it is documented. Anyway it is a matter of the next > version. > > I forgot to mention the patch itself, but what the patch does looks > fine to me. Disabling pause after setting SharedProteIsTriggered > prevents later re-pausing (from the sql function). Thanks for the review! I pushed the patch. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION