按需回放实时构建改为向Pageworker线程发送sigterm信号后,将ondemand_realtime_build_status置为BUILD_TO_DISABLED
This commit is contained in:
@ -423,10 +423,6 @@ static int CBSwitchoverPromote(void *db_handle, unsigned char origPrimaryId)
|
||||
pg_memory_barrier();
|
||||
ereport(LOG, (errmodule(MOD_DMS), errmsg("[SS switchover] Starting to promote standby.")));
|
||||
|
||||
if (ENABLE_ONDEMAND_REALTIME_BUILD) {
|
||||
OnDemandWaitRealtimeBuildShutDownInSwitchoverPromoting();
|
||||
}
|
||||
|
||||
SSNotifySwitchoverPromote();
|
||||
|
||||
const int WAIT_PROMOTE = 1200; /* wait 120 sec */
|
||||
|
@ -420,8 +420,6 @@ void HandleStartupInterruptsForExtremeRto()
|
||||
if (ENABLE_ONDEMAND_REALTIME_BUILD &&
|
||||
(SS_PERFORMING_SWITCHOVER || (SS_STANDBY_MODE && DMS_REFORM_TYPE_FOR_FAILOVER_OPENGAUSS))) {
|
||||
Assert(!SS_ONDEMAND_REALTIME_BUILD_DISABLED);
|
||||
ereport(LOG, (errmsg("[On-demand] start to shutdown realtime build, set status to BUILD_TO_DISABLED.")));
|
||||
g_instance.dms_cxt.SSRecoveryInfo.ondemand_realtime_build_status = BUILD_TO_DISABLED;
|
||||
proc_exit(0);
|
||||
} else {
|
||||
proc_exit(1);
|
||||
@ -689,6 +687,10 @@ static void StopRecoveryWorkers(int code, Datum arg)
|
||||
errmsg("parallel redo workers are going to stop, code:%d, arg:%lu",
|
||||
code, DatumGetUInt64(arg))));
|
||||
SendSingalToPageWorker(SIGTERM);
|
||||
if (ENABLE_ONDEMAND_REALTIME_BUILD && SS_ONDEMAND_REALTIME_BUILD_NORMAL) {
|
||||
g_instance.dms_cxt.SSRecoveryInfo.ondemand_realtime_build_status = BUILD_TO_DISABLED;
|
||||
ereport(LOG, (errmsg("[On-demand] start to shutdown realtime build, set status to BUILD_TO_DISABLED.")));
|
||||
}
|
||||
|
||||
uint64 count = 0;
|
||||
while (!DispathCouldExit()) {
|
||||
@ -1993,8 +1995,6 @@ void WaitRedoFinish()
|
||||
|
||||
void WaitRealtimeBuildShutdown()
|
||||
{
|
||||
g_instance.dms_cxt.SSRecoveryInfo.ondemand_realtime_build_status = BUILD_TO_DISABLED;
|
||||
|
||||
Assert(g_instance.pid_cxt.StartupPID != 0);
|
||||
SendPostmasterSignal(PMSIGNAL_DMS_TERM_STARTUP);
|
||||
while (true) {
|
||||
|
@ -3951,7 +3951,7 @@ void GetOndemandRecoveryStatus(ondemand_recovery_stat *stat)
|
||||
}
|
||||
|
||||
void RealtimeBuildReleaseRecoveryLatch(int code, Datum arg) {
|
||||
if (ENABLE_ONDEMAND_REALTIME_BUILD && SS_ONDEMAND_REALTIME_BUILD_SHUTDOWN) {
|
||||
if (ENABLE_ONDEMAND_REALTIME_BUILD) {
|
||||
volatile Latch* latch = &t_thrd.shemem_ptr_cxt.XLogCtl->recoveryWakeupLatch;
|
||||
if (latch->owner_pid == t_thrd.proc_cxt.MyProcPid && latch->is_shared) {
|
||||
DisownLatch(latch);
|
||||
|
@ -514,19 +514,6 @@ void OnDemandWaitRedoFinish()
|
||||
ondemand_extreme_rto::WaitRedoFinish();
|
||||
}
|
||||
|
||||
/**
|
||||
* Shutdown real-time build when standby node switchover promoting,
|
||||
* it will wait until StartUp Thread shutdown.
|
||||
*/
|
||||
void OnDemandWaitRealtimeBuildShutDownInSwitchoverPromoting()
|
||||
{
|
||||
if (g_instance.pid_cxt.StartupPID != 0) {
|
||||
Assert(SS_ONDEMAND_REALTIME_BUILD_NORMAL);
|
||||
OnDemandWaitRealtimeBuildShutDown();
|
||||
ereport(LOG, (errmsg("[SS reform] Shutdown real-time build when switchover promoting.")));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reform partner shutdown real-time build when failover,
|
||||
* it will wait until Startup Thread shutdown.
|
||||
|
Reference in New Issue
Block a user