Re: pg_get_wal_replay_pause_state() should not return 'paused' while a promotion is ongoing.
Fujii Masao <masao.fujii@oss.nttdata.com>
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: dilipbalaut@gmail.com, michael@paquier.xyz, pgsql-hackers@postgresql.org
Date: 2021-05-31T03:52:54Z
Lists: pgsql-hackers
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
Commits
-
Remove unnecessary use of Time::HiRes from 013_crash_restart.pl.
- df466d30c6ca 14.0 landed
-
Add regression test for recovery pause.
- 6bbc5c5e96b0 14.0 landed
-
Make standby promotion reset the recovery pause state to 'not paused'.
- 167bd4804995 14.0 landed
-
Prefer standby promotion over recovery pause.
- 496ee647ecd2 13.0 cited