From 1b839ebef689bf69822e86485b79b4ce3f0ac512 Mon Sep 17 00:00:00 2001 From: Xiao__Ma Date: Thu, 18 Mar 2021 11:11:41 +0800 Subject: [PATCH] =?UTF-8?q?update=20src/gausskernel/process/postmaster/pos?= =?UTF-8?q?tmaster.cpp.=20=E6=B7=BB=E5=8A=A0=E9=9B=86=E4=B8=AD=E5=BC=8Ftwo?= =?UTF-8?q?phasecleaner=E9=80=80=E5=87=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../process/postmaster/postmaster.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/gausskernel/process/postmaster/postmaster.cpp b/src/gausskernel/process/postmaster/postmaster.cpp index 0b948e1e9..19c162859 100755 --- a/src/gausskernel/process/postmaster/postmaster.cpp +++ b/src/gausskernel/process/postmaster/postmaster.cpp @@ -4055,7 +4055,14 @@ static void SIGHUP_handler(SIGNAL_ARGS) signal_child(g_instance.pid_cxt.StartupPID, SIGHUP); #ifdef PGXC /* PGXC_COORD */ - if (IS_PGXC_COORDINATOR && g_instance.pid_cxt.TwoPhaseCleanerPID != 0) + if ( +#ifdef ENABLE_MULTIPLE_NODES + IS_PGXC_COORDINATOR && +#else + (t_thrd.postmaster_cxt.HaShmData->current_mode == NORMAL_MODE || + t_thrd.postmaster_cxt.HaShmData->current_mode == PRIMARY_MODE) && +#endif + g_instance.pid_cxt.TwoPhaseCleanerPID != 0) signal_child(g_instance.pid_cxt.TwoPhaseCleanerPID, SIGHUP); if (GTM_LITE_CN && g_instance.pid_cxt.CsnminSyncPID != 0) { @@ -5554,7 +5561,14 @@ static void reaper(SIGNAL_ARGS) } /* Was it the twophasecleaner? If so, try to handle */ - if (IS_PGXC_COORDINATOR && pid == g_instance.pid_cxt.TwoPhaseCleanerPID) { + if ( +#ifdef ENABLE_MULTIPLE_NODES + IS_PGXC_COORDINATOR && +#else + (t_thrd.postmaster_cxt.HaShmData->current_mode == NORMAL_MODE || + t_thrd.postmaster_cxt.HaShmData->current_mode == PRIMARY_MODE) && +#endif + pid == g_instance.pid_cxt.TwoPhaseCleanerPID) { g_instance.pid_cxt.TwoPhaseCleanerPID = 0; if (!EXIT_STATUS_0(exitstatus))