fixed remove_lsn can not finished because palf leak.
This commit is contained in:
@ -167,6 +167,9 @@ void ObLogHandler::destroy()
|
|||||||
apply_status_ = NULL;
|
apply_status_ = NULL;
|
||||||
apply_service_ = NULL;
|
apply_service_ = NULL;
|
||||||
replay_service_ = NULL;
|
replay_service_ = NULL;
|
||||||
|
if (true == palf_handle_.is_valid()) {
|
||||||
|
palf_env_->close(palf_handle_);
|
||||||
|
}
|
||||||
lc_cb_ = NULL;
|
lc_cb_ = NULL;
|
||||||
rpc_proxy_ = NULL;
|
rpc_proxy_ = NULL;
|
||||||
palf_env_ = NULL;
|
palf_env_ = NULL;
|
||||||
|
|||||||
@ -311,7 +311,9 @@ int ObLogService::create_ls(const share::ObLSID &id,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObLogService::remove_ls(const ObLSID &id)
|
int ObLogService::remove_ls(const ObLSID &id,
|
||||||
|
ObLogHandler &log_handler,
|
||||||
|
ObLogRestoreHandler &restore_handler)
|
||||||
{
|
{
|
||||||
int ret = OB_SUCCESS;
|
int ret = OB_SUCCESS;
|
||||||
if (IS_NOT_INIT) {
|
if (IS_NOT_INIT) {
|
||||||
@ -322,10 +324,14 @@ int ObLogService::remove_ls(const ObLSID &id)
|
|||||||
} else if (OB_FAIL(replay_service_.remove_ls(id))) {
|
} else if (OB_FAIL(replay_service_.remove_ls(id))) {
|
||||||
CLOG_LOG(WARN, "failed to remove from replay_service", K(ret), K(id));
|
CLOG_LOG(WARN, "failed to remove from replay_service", K(ret), K(id));
|
||||||
// NB: remove palf_handle lastly.
|
// NB: remove palf_handle lastly.
|
||||||
} else if (OB_FAIL(palf_env_->remove(id.id()))) {
|
|
||||||
CLOG_LOG(WARN, "failed to remove from palf_env_", K(ret), K(id));
|
|
||||||
} else {
|
} else {
|
||||||
FLOG_INFO("ObLogService remove_ls success", K(ret), K(id));
|
log_handler.destroy();
|
||||||
|
restore_handler.destroy();
|
||||||
|
if (OB_FAIL(palf_env_->remove(id.id()))) {
|
||||||
|
CLOG_LOG(WARN, "failed to remove from palf_env_", K(ret), K(id));
|
||||||
|
} else {
|
||||||
|
FLOG_INFO("ObLogService remove_ls success", K(ret), K(id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@ -122,7 +122,9 @@ public:
|
|||||||
ObLogRestoreHandler &restore_handler);
|
ObLogRestoreHandler &restore_handler);
|
||||||
|
|
||||||
//删除日志流接口:外层调用create_ls()之后,后续流程失败,需要调用remove_ls()
|
//删除日志流接口:外层调用create_ls()之后,后续流程失败,需要调用remove_ls()
|
||||||
int remove_ls(const share::ObLSID &id);
|
int remove_ls(const share::ObLSID &id,
|
||||||
|
ObLogHandler &log_handler,
|
||||||
|
ObLogRestoreHandler &restore_handler);
|
||||||
|
|
||||||
int check_palf_exist(const share::ObLSID &id, bool &exist) const;
|
int check_palf_exist(const share::ObLSID &id, bool &exist) const;
|
||||||
//宕机重启恢复日志流接口,包括生成并初始化对应的ObReplayStatus结构
|
//宕机重启恢复日志流接口,包括生成并初始化对应的ObReplayStatus结构
|
||||||
|
|||||||
@ -329,7 +329,7 @@ int ObLS::remove_ls()
|
|||||||
if (OB_TMP_FAIL(log_handler_.unregister_rebuild_cb())) {
|
if (OB_TMP_FAIL(log_handler_.unregister_rebuild_cb())) {
|
||||||
LOG_WARN("unregister rebuild cb failed", K(ret), K(ls_meta_));
|
LOG_WARN("unregister rebuild cb failed", K(ret), K(ls_meta_));
|
||||||
}
|
}
|
||||||
if (OB_FAIL(logservice->remove_ls(ls_meta_.ls_id_))) {
|
if (OB_FAIL(logservice->remove_ls(ls_meta_.ls_id_, log_handler_, restore_handler_))) {
|
||||||
LOG_ERROR("remove log stream from logservice failed", K(ret), K(ls_meta_.ls_id_));
|
LOG_ERROR("remove log stream from logservice failed", K(ret), K(ls_meta_.ls_id_));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user