Auto switch freeze mode for palf.
This commit is contained in:
@ -556,8 +556,19 @@ bool PalfEnvImpl::FreezeLogFunctor::operator() (const LSKey &palf_id, PalfHandle
|
||||
int tmp_ret = OB_SUCCESS;
|
||||
if (NULL == palf_handle_impl) {
|
||||
PALF_LOG(ERROR, "palf_handle_impl is NULL", KP(palf_handle_impl), K(palf_id));
|
||||
} else if (OB_SUCCESS != (tmp_ret = palf_handle_impl->try_freeze_last_log())) {
|
||||
PALF_LOG(WARN, "try_freeze_last_log failed", K(tmp_ret), K(palf_id));
|
||||
} else if (OB_SUCCESS != (tmp_ret = palf_handle_impl->period_freeze_last_log())) {
|
||||
PALF_LOG(WARN, "period_freeze_last_log failed", K(tmp_ret), K(palf_id));
|
||||
} else {}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PalfEnvImpl::CheckFreezeModeFunctor::operator() (const LSKey &palf_id, PalfHandleImpl *palf_handle_impl)
|
||||
{
|
||||
int tmp_ret = OB_SUCCESS;
|
||||
if (NULL == palf_handle_impl) {
|
||||
PALF_LOG(ERROR, "palf_handle_impl is NULL", KP(palf_handle_impl), K(palf_id));
|
||||
} else if (OB_SUCCESS != (tmp_ret = palf_handle_impl->check_and_switch_freeze_mode())) {
|
||||
PALF_LOG(WARN, "check_and_switch_freeze_mode failed", K(tmp_ret), K(palf_id));
|
||||
} else {}
|
||||
return true;
|
||||
}
|
||||
@ -575,6 +586,19 @@ int PalfEnvImpl::try_switch_state_for_all()
|
||||
return ret;
|
||||
}
|
||||
|
||||
int PalfEnvImpl::check_and_switch_freeze_mode()
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
CheckFreezeModeFunctor check_freeze_mode_functor;
|
||||
if (IS_NOT_INIT) {
|
||||
ret = OB_NOT_INIT;
|
||||
PALF_LOG(WARN, "PalfEnvImpl is not inited", K(ret));
|
||||
} else if (OB_FAIL(palf_handle_impl_map_.for_each(check_freeze_mode_functor))) {
|
||||
PALF_LOG(WARN, "palf_handle_impl_map_ for_each failed", K(ret));
|
||||
} else {}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int PalfEnvImpl::try_freeze_log_for_all()
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user