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

Lines changed: 8 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy