From 9ac05cd59444d7f07c50b92d90fe380f45e1bc39 Mon Sep 17 00:00:00 2001 From: congzhou2603 Date: Tue, 17 Oct 2023 11:04:15 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90bugfix=E3=80=91=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E8=BD=AE=E6=8C=89=E9=9C=80=E5=9B=9E=E6=94=BE?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=90=8E=EF=BC=8C=E5=A4=87=E6=9C=BAfailover?= =?UTF-8?q?=E6=97=B6=E5=A4=87=E8=8A=82=E7=82=B9core=E6=8E=89=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../process/postmaster/postmaster.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gausskernel/process/postmaster/postmaster.cpp b/src/gausskernel/process/postmaster/postmaster.cpp index e8014153f..859ecb8c7 100644 --- a/src/gausskernel/process/postmaster/postmaster.cpp +++ b/src/gausskernel/process/postmaster/postmaster.cpp @@ -91,6 +91,7 @@ #include "commands/verify.h" #include "catalog/pg_control.h" #include "dbmind/hypopg_index.h" +#include "ddes/dms/ss_dms.h" #include "instruments/instr_unique_sql.h" #include "instruments/instr_user.h" #include "instruments/percentile.h" @@ -3977,8 +3978,9 @@ static int ServerLoop(void) result = BackendStartup(port, isConnectHaPort); } - if (SS_CLUSTER_ONDEMAND_RECOVERY && SS_IN_REFORM && - result != STATUS_OK && pmState == PM_WAIT_BACKENDS) { + if (SS_IN_ONDEMAND_RECOVERY && SS_IN_REFORM && + result != STATUS_OK && pmState == PM_WAIT_BACKENDS && + (dms_reform_failed() || dms_reform_last_failed())) { SSOndemandProcExitIfStayWaitBackends(); } if (result != STATUS_OK) { @@ -15106,10 +15108,10 @@ void SSOndemandProcExitIfStayWaitBackends() failTimes++; } if (pmState == PM_WAIT_BACKENDS) { - ereport(WARNING, (errmsg("Proc exit because pmState stay %s for %d times, " - "when reform failed and in ondemand recovery, " - "to avoid pmState being stuck in PM_WAIT_BACKENDS.", - GetPMState(pmState), WAIT_PMSTATE_UPDATE_TRIES))); - proc_exit(1); + ereport(WARNING, (errmodule(MOD_DMS), + errmsg("[On-demand] Proc exit because pmState stay PM_WAIT_BACKENDS for %d times, " + "when reform failed and in ondemand recovery, to avoid pmState being stuck in PM_WAIT_BACKENDS.", + WAIT_PMSTATE_UPDATE_TRIES))); + _exit(0); } } \ No newline at end of file