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 51e880f1f6104e5fa02c34d030cfeec0e22df9b3..4456afbd5d235197713aee29dc4990f3b2891cdf 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 6a01a780b16a67e6a43c7e40ff8c4b4f16361aab..c49404dafb1bd161840304c7db0859c81a9a6d05 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"))); } }