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

Commit 2d173b6

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

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8838,7 +8838,7 @@ CreateCheckPoint(int flags)
88388838
* We now have ProcLastRecPtr = start of actual checkpoint record, recptr
88398839
* = end of actual checkpoint record.
88408840
*/
8841-
if (shutdown && checkPoint.redo != ProcLastRecPtr && *OnlineUpgradePath == '\0')
8841+
if (shutdown && checkPoint.redo != ProcLastRecPtr)
88428842
ereport(PANIC,
88438843
(errmsg("concurrent write-ahead log activity while database system is shutting down")));
88448844

src/backend/port/sysv_shmem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,8 +870,8 @@ PGSharedMemoryReAttach(void)
870870
else
871871
state = PGSharedMemoryAttach(shmid, UsedShmemSegAddr, &hdr);
872872
if (state != SHMSTATE_ATTACHED)
873-
elog(FATAL, "could not reattach to shared memory (key=%d, addr=%p): %m",
874-
(int) UsedShmemSegID, UsedShmemSegAddr);
873+
elog(FATAL, "could not reattach to shared memory (key=%d, addr=%p, state=%d): %m",
874+
(int) UsedShmemSegID, UsedShmemSegAddr, state);
875875
if (hdr != origUsedShmemSegAddr)
876876
elog(FATAL, "reattaching to shared memory returned unexpected address (got %p, expected %p)",
877877
hdr, origUsedShmemSegAddr);

src/backend/postmaster/checkpointer.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "miscadmin.h"
4848
#include "pgstat.h"
4949
#include "postmaster/bgwriter.h"
50+
#include "postmaster/postmaster.h"
5051
#include "replication/syncrep.h"
5152
#include "storage/bufmgr.h"
5253
#include "storage/condition_variable.h"
@@ -823,7 +824,13 @@ chkpt_quickdie(SIGNAL_ARGS)
823824
* should ensure the postmaster sees this as a crash, too, but no harm in
824825
* being doubly sure.)
825826
*/
826-
_exit(2);
827+
if (*OnlineUpgradePath != '\0')
828+
{
829+
/* Normal exit from the checkpointer is here */
830+
proc_exit(0); /* done */
831+
}
832+
else
833+
_exit(2);
827834
}
828835

829836
/* SIGHUP: set flag to re-read config file at next convenient time */

src/backend/postmaster/postmaster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ UpgradePostgres(void)
786786
IsOnlineUpgrade = true;
787787
TerminateChildren(SIGTERM);
788788
if (CheckpointerPID != 0)
789-
signal_child(CheckpointerPID, SIGUSR2);
789+
signal_child(CheckpointerPID, SIGQUIT/*SIGUSR2*/);
790790

791791
if (!SavePostmasterParameters())
792792
{

0 commit comments

Comments
 (0)