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 1lnYz8-0006Nn-2m for pgsql-hackers@arkaria.postgresql.org; Mon, 31 May 2021 03:53:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lnYz7-0003S2-0j for pgsql-hackers@arkaria.postgresql.org; Mon, 31 May 2021 03:53:01 +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 1lnYz6-0003Ru-PW for pgsql-hackers@lists.postgresql.org; Mon, 31 May 2021 03:53:00 +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 1lnYz4-0007di-JZ for pgsql-hackers@postgresql.org; Mon, 31 May 2021 03:52:59 +0000 Received: from hnk.local (p2388012-ipbf1027funabasi.chiba.ocn.ne.jp [118.6.6.12]) by oss.nttdata.com (Postfix) with ESMTPSA id 040886096C; Mon, 31 May 2021 12:52:54 +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. From: Fujii Masao To: Kyotaro Horiguchi Cc: dilipbalaut@gmail.com, michael@paquier.xyz, pgsql-hackers@postgresql.org References: <20210519.152529.1656496447023808157.horikyota.ntt@gmail.com> <25396c69-9f70-ca3e-5de3-f3a108ae2a26@oss.nttdata.com> <20210519.164352.1786666023204393975.horikyota.ntt@gmail.com> <63ad1368-18e2-8900-8443-524bdfb1bef5@oss.nttdata.com> Message-ID: <613321d7-e629-90ac-1006-8f63b4713c8e@oss.nttdata.com> Date: Mon, 31 May 2021 12:52:54 +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: <63ad1368-18e2-8900-8443-524bdfb1bef5@oss.nttdata.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/05/19 19:24, Fujii Masao wrote: > > > On 2021/05/19 16:43, Kyotaro Horiguchi wrote: >> +1 for adding some tests for pg_wal_replay_pause() but the test seems >> like checking only that pg_get_wal_replay_pause_state() returns the >> expected state value.  Don't we need to check that the recovery is >> actually paused and that the promotion happens at expected LSN? > > Sounds good. Attached is the updated version of the patch. > I added such checks into the test. > > BTW, while reading some recovery regression tests, I found that > 013_crash_restart.pl has "use Time::HiRes qw(usleep)" but it seems > not necessary. We can safely remove that? Patch attached. Barring any objections, I'm thinking to commit these two patches. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION