Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit aa79dae

Browse files
committed
[refer #PGPRO-3213] Change way of terminating checkpointer during online upgrade
1 parent 2d173b6 commit aa79dae

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/backend/postmaster/checkpointer.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ double CheckPointCompletionTarget = 0.5;
153153
*/
154154
static volatile sig_atomic_t got_SIGHUP = false;
155155
static volatile sig_atomic_t shutdown_requested = false;
156+
static volatile sig_atomic_t fast_shutdown_requested = false;
156157

157158
/*
158159
* Private state
@@ -370,6 +371,11 @@ CheckpointerMain(void)
370371
*/
371372
UpdateSharedMemoryConfig();
372373
}
374+
if (fast_shutdown_requested)
375+
{
376+
/* Normal exit from the checkpointer is here */
377+
proc_exit(0); /* done */
378+
}
373379
if (shutdown_requested)
374380
{
375381
/*
@@ -674,6 +680,7 @@ CheckpointWriteDelay(int flags, double progress)
674680
*/
675681
if (!(flags & CHECKPOINT_IMMEDIATE) &&
676682
!shutdown_requested &&
683+
!fast_shutdown_requested &&
677684
!ImmediateCheckpointRequested() &&
678685
IsCheckpointOnSchedule(progress))
679686
{
@@ -826,8 +833,7 @@ chkpt_quickdie(SIGNAL_ARGS)
826833
*/
827834
if (*OnlineUpgradePath != '\0')
828835
{
829-
/* Normal exit from the checkpointer is here */
830-
proc_exit(0); /* done */
836+
fast_shutdown_requested = true;
831837
}
832838
else
833839
_exit(2);

0 commit comments

Comments
 (0)