From b2b04c1764c3e4f30ab4374e26074ba55fbe53dd Mon Sep 17 00:00:00 2001 From: chendong76 <1209756284@qq.com> Date: Wed, 2 Aug 2023 16:18:53 +0800 Subject: [PATCH] =?UTF-8?q?[bugfix]=E8=A7=A3=E5=86=B3=E6=8C=89=E9=9C=80?= =?UTF-8?q?=E5=9B=9E=E6=94=BE=E9=83=A8=E5=88=86=E9=97=AE=E9=A2=98=EF=BC=9A?= =?UTF-8?q?1.=E9=83=A8=E5=88=86=E6=97=A5=E5=BF=97=E5=9B=9E=E6=94=BE?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98=EF=BC=9B?= =?UTF-8?q?2.=E6=8C=89=E9=9C=80=E5=9B=9E=E6=94=BE=E6=9C=AA=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E7=BB=93=E6=9D=9F=E5=90=8E=E5=A4=9A=E6=AC=A1=E9=87=8D?= =?UTF-8?q?=E5=90=AF=EF=BC=8C=E5=AF=BC=E8=87=B4=E6=89=BE=E4=B8=8D=E5=88=B0?= =?UTF-8?q?redo=E7=82=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transam/ondemand_extreme_rto/page_redo.cpp | 13 +++++++------ src/gausskernel/storage/access/transam/xlog.cpp | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/gausskernel/storage/access/transam/ondemand_extreme_rto/page_redo.cpp b/src/gausskernel/storage/access/transam/ondemand_extreme_rto/page_redo.cpp index 51e880f1f6..4456afbd5d 100644 --- a/src/gausskernel/storage/access/transam/ondemand_extreme_rto/page_redo.cpp +++ b/src/gausskernel/storage/access/transam/ondemand_extreme_rto/page_redo.cpp @@ -1074,14 +1074,10 @@ static void OnDemandPageManagerRedoSegParseState(XLogRecParseState *preState) Assert(g_redoWorker->slotId == 0); switch (preState->blockparse.blockhead.block_valid) { case BLOCK_DATA_SEG_EXTEND: - GetRedoStartTime(g_redoWorker->timeCostList[TIME_COST_STEP_4]); OnDemandPageManagerProcSegPipeLineSyncState(preState); - CountRedoTime(g_redoWorker->timeCostList[TIME_COST_STEP_4]); break; case BLOCK_DATA_SEG_FULL_SYNC_TYPE: - GetRedoStartTime(g_redoWorker->timeCostList[TIME_COST_STEP_8]); OnDemandPageManagerProcSegFullSyncState(preState); - CountRedoTime(g_redoWorker->timeCostList[TIME_COST_STEP_8]); break; case BLOCK_DATA_SEG_FILE_EXTEND_TYPE: default: @@ -1133,14 +1129,19 @@ void PageManagerRedoParseState(XLogRecParseState *preState) XLogBlockParseStateRelease(preState); break; case BLOCK_DATA_CREATE_DATABASE_TYPE: - case BLOCK_DATA_SEG_FILE_EXTEND_TYPE: GetRedoStartTime(g_redoWorker->timeCostList[TIME_COST_STEP_6]); - OnDemandPageManagerRedoSegParseState(preState); + RedoPageManagerDistributeBlockRecord(hashMap, NULL); + /* wait until queue empty */ + WaitCurrentPipeLineRedoWorkersQueueEmpty(); + /* do atcual action */ + RedoPageManagerSyncDdlAction(preState); CountRedoTime(g_redoWorker->timeCostList[TIME_COST_STEP_6]); break; + case BLOCK_DATA_SEG_FILE_EXTEND_TYPE: case BLOCK_DATA_SEG_FULL_SYNC_TYPE: GetRedoStartTime(g_redoWorker->timeCostList[TIME_COST_STEP_8]); OnDemandPageManagerRedoSegParseState(preState); + CountRedoTime(g_redoWorker->timeCostList[TIME_COST_STEP_8]); break; case BLOCK_DATA_CREATE_TBLSPC_TYPE: GetRedoStartTime(g_redoWorker->timeCostList[TIME_COST_STEP_7]); diff --git a/src/gausskernel/storage/access/transam/xlog.cpp b/src/gausskernel/storage/access/transam/xlog.cpp index 6a01a780b1..c49404dafb 100755 --- a/src/gausskernel/storage/access/transam/xlog.cpp +++ b/src/gausskernel/storage/access/transam/xlog.cpp @@ -10336,7 +10336,7 @@ void StartupXLOG(void) t_thrd.xlog_cxt.InRecovery = false; g_instance.roach_cxt.isRoachRestore = false; - if (!SS_STANDBY_FAILOVER && !SS_STANDBY_PROMOTING && !SS_IN_ONDEMAND_RECOVERY) { + if (!SS_STANDBY_FAILOVER && !SS_STANDBY_PROMOTING && !SS_IN_ONDEMAND_RECOVERY && SSOndemandRecoveryExitNormal) { LWLockAcquire(ControlFileLock, LW_EXCLUSIVE); t_thrd.shemem_ptr_cxt.ControlFile->state = DB_IN_PRODUCTION; t_thrd.shemem_ptr_cxt.ControlFile->time = (pg_time_t)time(NULL); @@ -10464,14 +10464,14 @@ void StartupXLOG(void) } } - if (SS_STANDBY_FAILOVER || SS_STANDBY_PROMOTING) { + if (SS_STANDBY_FAILOVER || SS_STANDBY_PROMOTING || !SSOndemandRecoveryExitNormal) { if (SS_STANDBY_FAILOVER) { g_instance.dms_cxt.SSRecoveryInfo.failover_ckpt_status = ALLOW_CKPT; pg_memory_barrier(); } if (!SS_IN_ONDEMAND_RECOVERY) { ereport(LOG, (errmodule(MOD_DMS), - errmsg("[SS switchover/SS failover] standby promoting: start full checkpoint."))); + errmsg("[SS switchover/SS failover/SS normal reform] start full checkpoint."))); RequestCheckpoint(CHECKPOINT_FORCE | CHECKPOINT_IMMEDIATE | CHECKPOINT_WAIT); LWLockAcquire(ControlFileLock, LW_EXCLUSIVE); t_thrd.shemem_ptr_cxt.ControlFile->state = DB_IN_PRODUCTION; @@ -10480,7 +10480,7 @@ void StartupXLOG(void) LWLockRelease(ControlFileLock); SSRecheckBufferPool(); ereport(LOG, (errmodule(MOD_DMS), - errmsg("[SS switchover/SS failover] standby promoting: finished full checkpoint" + errmsg("[SS switchover/SS failover/SS normal reform] finished full checkpoint" "and update control file"))); } } -- Gitee