[kill -15][vostest]enhance check_kill_gracefully case
This commit is contained in:
@ -621,6 +621,10 @@ void ObServer::destroy()
|
||||
location_service_.destroy();
|
||||
FLOG_INFO("location service destroyed");
|
||||
|
||||
FLOG_INFO("begin to destroy ts mgr");
|
||||
OB_TS_MGR.destroy();
|
||||
FLOG_INFO("ts mgr destroyed");
|
||||
|
||||
FLOG_INFO("begin to destroy weak read service");
|
||||
weak_read_service_.destroy();
|
||||
FLOG_INFO("weak read service destroyed");
|
||||
|
||||
@ -1665,6 +1665,7 @@ int ObMultiVersionSchemaService::destroy()
|
||||
int ret = OB_SUCCESS;
|
||||
schema_store_map_.destroy();
|
||||
ddl_trans_controller_.destroy();
|
||||
schema_cache_.destroy();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -390,6 +390,21 @@ ObSchemaCache::ObSchemaCache()
|
||||
|
||||
ObSchemaCache::~ObSchemaCache()
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
|
||||
void ObSchemaCache::destroy()
|
||||
{
|
||||
tablet_cache_.destroy();
|
||||
cache_.destroy();
|
||||
|
||||
NoSwapCache::iterator iter;
|
||||
for (iter = sys_cache_.begin(); iter != sys_cache_.end(); ++iter) {
|
||||
if (OB_NOT_NULL(iter->second)) {
|
||||
mem_context_->free((void *)iter->second);
|
||||
}
|
||||
}
|
||||
sys_cache_.destroy();
|
||||
if (mem_context_ != nullptr) {
|
||||
DESTROY_CONTEXT(mem_context_);
|
||||
mem_context_ = nullptr;
|
||||
|
||||
@ -142,6 +142,7 @@ public:
|
||||
virtual ~ObSchemaCache();
|
||||
|
||||
int init();
|
||||
void destroy();
|
||||
int get_schema(const ObSchemaType schema_type,
|
||||
const uint64_t tenant_id,
|
||||
const uint64_t schema_id,
|
||||
|
||||
@ -240,6 +240,24 @@ void ObTsMgr::destroy()
|
||||
stop();
|
||||
wait();
|
||||
}
|
||||
(void)share::ObThreadPool::destroy();
|
||||
(void)ts_worker_.destroy();
|
||||
|
||||
ObSEArray<uint64_t, 1> ids;
|
||||
GetALLTenantFunctor get_all_tenant_functor(ids);
|
||||
ts_source_info_map_.for_each(get_all_tenant_functor);
|
||||
for (int64_t i = 0; i < ids.count(); i++) {
|
||||
const uint64_t tenant_id = ids.at(i);
|
||||
delete_tenant_(tenant_id);
|
||||
}
|
||||
ids.reset();
|
||||
ts_source_info_map_.destroy();
|
||||
|
||||
location_adapter_def_.destroy();
|
||||
lock_.destroy();
|
||||
server_.reset();
|
||||
location_adapter_ = NULL;
|
||||
is_running_ = false;
|
||||
is_inited_ = false;
|
||||
TRANS_LOG(INFO, "ObTsMgr destroyed");
|
||||
}
|
||||
@ -251,7 +269,6 @@ void ObTsMgr::destroy()
|
||||
ObGtsRequestRpcFactory::release(gts_request_rpc_);
|
||||
gts_request_rpc_ = NULL;
|
||||
}
|
||||
location_adapter_def_.destroy();
|
||||
}
|
||||
|
||||
// 执行gts任务刷新,由一个专门的线程来负责
|
||||
|
||||
@ -238,6 +238,29 @@ private:
|
||||
common::ObIArray<uint64_t> &array_;
|
||||
};
|
||||
|
||||
class GetALLTenantFunctor
|
||||
{
|
||||
public:
|
||||
GetALLTenantFunctor(common::ObIArray<uint64_t> &array)
|
||||
: array_(array)
|
||||
{
|
||||
array_.reset();
|
||||
}
|
||||
~GetALLTenantFunctor() {}
|
||||
bool operator()(const ObTsTenantInfo >s_tenant_info, ObTsSourceInfo *ts_source_info)
|
||||
{
|
||||
int ret = common::OB_SUCCESS;
|
||||
if (OB_FAIL(array_.push_back(gts_tenant_info.get_value()))) {
|
||||
TRANS_LOG(WARN, "push back tenant failed", K(ret), K(gts_tenant_info));
|
||||
} else {
|
||||
// do nothing
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private:
|
||||
common::ObIArray<uint64_t> &array_;
|
||||
};
|
||||
|
||||
class ObTsMgr;
|
||||
class ObTsSourceInfoGuard
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user