Skip to content

Commit 167bd48

Browse files
committed
Make standby promotion reset the recovery pause state to 'not paused'.
If a promotion is triggered while recovery is paused, the paused state ends and promotion continues. But previously in that case pg_get_wal_replay_pause_state() returned 'paused' wrongly while a promotion was ongoing. This commit changes a standby promotion so that it marks the recovery pause state as 'not paused' when it's triggered, to fix the issue. Author: Fujii Masao Reviewed-by: Dilip Kumar, Kyotaro Horiguchi Discussion: https://postgr.es/m/f706876c-4894-0ba5-6f4d-79803eeea21b@oss.nttdata.com
1 parent 0a442a4 commit 167bd48

File tree

1 file changed

+8
-0
lines changed
  • src/backend/access/transam

1 file changed

+8
-0
lines changed

src/backend/access/transam/xlog.c

+8
Original file line numberDiff line numberDiff line change
@@ -12825,6 +12825,14 @@ SetPromoteIsTriggered(void)
1282512825
XLogCtl->SharedPromoteIsTriggered = true;
1282612826
SpinLockRelease(&XLogCtl->info_lck);
1282712827

12828+
/*
12829+
* Mark the recovery pause state as 'not paused' because the paused state
12830+
* ends and promotion continues if a promotion is triggered while recovery
12831+
* is paused. Otherwise pg_get_wal_replay_pause_state() can mistakenly
12832+
* return 'paused' while a promotion is ongoing.
12833+
*/
12834+
SetRecoveryPause(false);
12835+
1282812836
LocalPromoteIsTriggered = true;
1282912837
}
1283012838

0 commit comments

Comments
 (0)