destroy thread for kill 15

This commit is contained in:
zhjc1124
2023-05-29 07:41:18 +00:00
committed by ob-robot
parent 13dac20342
commit e6fcf5d6ad
11 changed files with 127 additions and 2 deletions

View File

@ -475,6 +475,26 @@ void ObServer::destroy()
FLOG_INFO("[OBSERVER_NOTICE] destroy observer begin");
if (is_arbitration_mode()) {
} else if (!has_destroy_ && has_stopped_) {
FLOG_INFO("begin destroy signal worker");
sig_worker_->destroy();
FLOG_INFO("signal worker destroyed");
FLOG_INFO("begin destroy signal handle");
signal_handle_->destroy();
FLOG_INFO("signal handle destroyed");
FLOG_INFO("begin to destroy ObLogger");
OB_LOGGER.destroy();
FLOG_INFO("ObLogger destroyed");
FLOG_INFO("active session history task destroyed");
ObClockGenerator::destroy();
FLOG_INFO("clock generator destroyed");
FLOG_INFO("opt stat manager destroyed");
ObOptStatManager::get_instance().destroy();
FLOG_INFO("opt stat manager destroyed");
FLOG_INFO("begin to destroy active session history task");
ObActiveSessHistTask::get_instance().destroy();
FLOG_INFO("active session history task destroyed");
@ -985,6 +1005,14 @@ int ObServer::stop()
FLOG_INFO("end to stop imc tasks", KR(ret));
#endif
FLOG_INFO("begin stop signal worker");
sig_worker_->stop();
FLOG_INFO("stop signal worker success");
FLOG_INFO("begin stop signal handle");
signal_handle_->stop();
FLOG_INFO("stop signal handle success");
FLOG_INFO("begin to stop server blacklist");
TG_STOP(lib::TGDefIDs::Blacklist);
FLOG_INFO("server blacklist stopped");
@ -1121,10 +1149,17 @@ int ObServer::stop()
bl_service_.stop();
FLOG_INFO("blacklist service stopped");
FLOG_INFO("begin to stop tenant timezone manager");
tenant_timezone_mgr_.stop();
FLOG_INFO("tenant timezone manager stopped");
//FLOG_INFO("begin stop partition scheduler");
//ObPartitionScheduler::get_instance().stop_merge();
//FLOG_INFO("partition scheduler stopped", KR(ret));
FLOG_INFO("begin to stop opt stat manager ");
ObOptStatManager::get_instance().stop();
FLOG_INFO("opt stat manager stopped");
FLOG_INFO("begin to stop server checkpoint slog handler");
ObServerCheckpointSlogHandler::get_instance().stop();
FLOG_INFO("server checkpoint slog handler stopped");
@ -1234,6 +1269,15 @@ int ObServer::wait()
if (is_arbitration_mode()) {
} else {
FLOG_INFO("begin wait signal worker");
sig_worker_->wait();
FLOG_INFO("wait signal worker success");
FLOG_INFO("begin wait signal handle");
signal_handle_->wait();
FLOG_INFO("wait signal handle success");
FLOG_INFO("begin to wait active session hist task");
ObActiveSessHistTask::get_instance().wait();
FLOG_INFO("wait active session hist task success");
@ -1376,6 +1420,14 @@ int ObServer::wait()
bl_service_.wait();
FLOG_INFO("wait blacklist service success");
FLOG_INFO("begin to wait tenant timezone manager");
tenant_timezone_mgr_.wait();
FLOG_INFO("wait tenant timezone manager success");
FLOG_INFO("begin to wait opt stat manager");
ObOptStatManager::get_instance().wait();
FLOG_INFO("wait opt stat manager success");
FLOG_INFO("begin to wait server checkpoint slog handler");
ObServerCheckpointSlogHandler::get_instance().wait();
FLOG_INFO("wait server checkpoint slog handler success");

View File

@ -105,7 +105,6 @@ ObTenantTimezoneMgr::ObTenantTimezoneMgr()
ObTenantTimezoneMgr::~ObTenantTimezoneMgr()
{
TG_DESTROY(lib::TGDefIDs::TIMEZONE_MGR);
}
ObTenantTimezoneMgr &ObTenantTimezoneMgr::get_instance()
@ -149,8 +148,19 @@ void ObTenantTimezoneMgr::init(tenant_timezone_map_getter tz_map_getter)
is_inited_ = true;
}
void ObTenantTimezoneMgr::stop()
{
TG_STOP(lib::TGDefIDs::TIMEZONE_MGR);
}
void ObTenantTimezoneMgr::wait()
{
TG_WAIT(lib::TGDefIDs::TIMEZONE_MGR);
}
void ObTenantTimezoneMgr::destroy()
{
TG_DESTROY(lib::TGDefIDs::TIMEZONE_MGR);
timezone_map_.destroy();
}

View File

@ -137,6 +137,9 @@ public:
void set_start_refresh(bool start) { start_refresh_ = start; }
bool is_usable() { return usable_; }
void set_usable() { usable_ = true; }
void stop();
void wait();
void destroy();
private:

View File

@ -73,6 +73,21 @@ int ObConfigManager::init(ObMySQLProxy &sql_proxy, const ObAddr &server)
return ret;
}
void ObConfigManager::stop()
{
TG_STOP(lib::TGDefIDs::CONFIG_MGR);
}
void ObConfigManager::wait()
{
TG_WAIT(lib::TGDefIDs::CONFIG_MGR);
}
void ObConfigManager::destroy()
{
TG_DESTROY(lib::TGDefIDs::CONFIG_MGR);
}
int ObConfigManager::reload_config()
{
int ret = OB_SUCCESS;

View File

@ -44,6 +44,9 @@ public:
int init(const ObAddr &server);
int init(ObMySQLProxy &sql_proxy, const ObAddr &server);
void stop();
void wait();
void destroy();
int check_header_change(const char* path, const char* buf) const;
// manual dump to file named by path

View File

@ -319,12 +319,14 @@ void ObLocationService::stop()
{
ls_location_service_.stop();
tablet_ls_service_.stop();
vtable_location_service_.stop();
}
void ObLocationService::wait()
{
ls_location_service_.wait();
tablet_ls_service_.wait();
vtable_location_service_.wait();
}
int ObLocationService::destroy()
@ -334,6 +336,8 @@ int ObLocationService::destroy()
LOG_WARN("destroy ls_location_service failed", KR(ret));
} else if (OB_FAIL(tablet_ls_service_.destroy())) {
LOG_WARN("destroy tablet_ls_service failed", KR(ret));
} else if(OB_FAIL(vtable_location_service_.destroy())){
LOG_WARN("destroy vtable_location_service failed", KR(ret));
} else {
stopped_ = true;
inited_ = false;

View File

@ -90,6 +90,23 @@ int ObVTableLocationService::init(
return ret;
}
void ObVTableLocationService::stop()
{
update_queue_.stop();
}
void ObVTableLocationService::wait()
{
update_queue_.wait();
}
int ObVTableLocationService::destroy()
{
int ret = OB_SUCCESS;
update_queue_.destroy();
vtable_cache_.destroy();
return ret;
}
//TODO: 1.remove ObPartitionLocation 2.add auto renew 3.cached by tenant_id
int ObVTableLocationService::vtable_get(
const uint64_t tenant_id,

View File

@ -77,6 +77,9 @@ public:
ObIAliveServerTracer &server_tracer,
ObRsMgr &rs_mgr,
obrpc::ObCommonRpcProxy &rpc_proxy);
void stop();
void wait();
int destroy();
int vtable_get(
const uint64_t tenant_id,
const uint64_t table_id,

View File

@ -91,6 +91,21 @@ int ObOptStatManager::init(ObMySQLProxy *proxy,
return ret;
}
void ObOptStatManager::stop()
{
refresh_stat_task_queue_.stop();
}
void ObOptStatManager::wait()
{
refresh_stat_task_queue_.wait();
}
void ObOptStatManager::destroy()
{
refresh_stat_task_queue_.destroy();
}
int ObOptStatManager::add_refresh_stat_task(const obrpc::ObUpdateStatCacheArg &analyze_arg)
{
int ret = OB_SUCCESS;

View File

@ -35,7 +35,9 @@ public:
virtual ~ObOptStatManager() {}
virtual int init(ObMySQLProxy *proxy,
ObServerConfig *config);
virtual void stop();
virtual void wait();
virtual void destroy();
static int64_t get_default_data_size();
static int64_t get_default_avg_row_size();

View File

@ -53,6 +53,7 @@ void ObLocalityManager::destroy()
TG_DESTROY(lib::TGDefIDs::LocalityReload);
locality_info_.destroy();
server_locality_cache_.destroy();
refresh_locality_task_queue_.destroy();
STORAGE_LOG(INFO, "ObLocalityManager destroy finished");
}
}