提交 ef6584d4 编写于 作者: H HaHaJeff 提交者: wangzelin.wzl

fixed remove_lsn can not finished because palf leak.

上级 1b4fe9e8
......@@ -167,6 +167,9 @@ void ObLogHandler::destroy()
apply_status_ = NULL;
apply_service_ = NULL;
replay_service_ = NULL;
if (true == palf_handle_.is_valid()) {
palf_env_->close(palf_handle_);
}
lc_cb_ = NULL;
rpc_proxy_ = NULL;
palf_env_ = NULL;
......
......@@ -311,7 +311,9 @@ int ObLogService::create_ls(const share::ObLSID &id,
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;
if (IS_NOT_INIT) {
......@@ -322,10 +324,14 @@ int ObLogService::remove_ls(const ObLSID &id)
} else if (OB_FAIL(replay_service_.remove_ls(id))) {
CLOG_LOG(WARN, "failed to remove from replay_service", K(ret), K(id));
// 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 {
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;
......
......@@ -122,7 +122,9 @@ public:
ObLogRestoreHandler &restore_handler);
//删除日志流接口:外层调用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;
//宕机重启恢复日志流接口,包括生成并初始化对应的ObReplayStatus结构
......
......@@ -329,7 +329,7 @@ int ObLS::remove_ls()
if (OB_TMP_FAIL(log_handler_.unregister_rebuild_cb())) {
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_));
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册