[FEAT MERGE] system resource optimization

Co-authored-by: tushicheng <18829573815@163.com>
Co-authored-by: HaHaJeff <jeffzhouhhh@gmail.com>
Co-authored-by: dimstars <liangjinrongcm@gmail.com>
This commit is contained in:
obdev
2023-08-29 10:41:01 +00:00
committed by ob-robot
parent 7678a4a676
commit 81b8923b14
191 changed files with 2817 additions and 2464 deletions

View File

@ -36,7 +36,7 @@
#include "observer/ob_server_utils.h"
#include "observer/ob_rpc_extra_payload.h"
#include "observer/omt/ob_tenant_timezone_mgr.h"
#include "observer/omt/ob_tenant_srs_mgr.h"
#include "observer/omt/ob_tenant_srs.h"
#include "observer/table/ob_table_rpc_processor.h"
#include "observer/mysql/ob_query_retry_ctrl.h"
#include "rpc/obrpc/ob_rpc_handler.h"
@ -166,7 +166,6 @@ ObServer::ObServer()
reload_config_(config_, gctx_), config_mgr_(config_, reload_config_),
tenant_config_mgr_(omt::ObTenantConfigMgr::get_instance()),
tenant_timezone_mgr_(omt::ObTenantTimezoneMgr::get_instance()),
tenant_srs_mgr_(omt::ObTenantSrsMgr::get_instance()),
schema_service_(share::schema::ObMultiVersionSchemaService::get_instance()),
lst_operator_(), tablet_operator_(),
server_tracer_(),
@ -291,8 +290,6 @@ int ObServer::init(const ObServerOptions &opts, const ObPLogWriterCfg &log_cfg)
ret = OB_ELECTION_ASYNC_LOG_WARN_INIT;
} else if (OB_FAIL(init_tz_info_mgr())) {
LOG_ERROR("init tz_info_mgr failed", KR(ret));
} else if (OB_FAIL(init_srs_mgr())) {
LOG_ERROR("init srs_mgr fail", K(ret));
} else if (OB_FAIL(ObSqlTaskFactory::get_instance().init())) {
LOG_ERROR("init sql task factory failed", KR(ret));
}
@ -434,8 +431,6 @@ int ObServer::init(const ObServerOptions &opts, const ObPLogWriterCfg &log_cfg)
} else if (OB_FAIL(ObOptStatManager::get_instance().init(
&sql_proxy_, &config_))) {
LOG_ERROR("init opt stat manager failed", KR(ret));
} else if (OB_FAIL(ObOptStatMonitorManager::get_instance().init(&sql_proxy_))) {
LOG_ERROR("init opt stat monitor manager failed", KR(ret));
} else if (OB_FAIL(lst_operator_.set_callback_for_obs(
rs_rpc_proxy_, srv_rpc_proxy_, rs_mgr_, sql_proxy_))) {
LOG_ERROR("set_use_rpc_table failed", KR(ret));
@ -720,10 +715,6 @@ void ObServer::destroy()
tenant_timezone_mgr_.destroy();
FLOG_INFO("tenant timezone manager destroyed");
FLOG_INFO("begin to destroy tenant srs manager");
tenant_srs_mgr_.destroy();
FLOG_INFO("tenant srs manager destroyed");
FLOG_INFO("begin to destroy ObMdsEventBuffer");
ObMdsEventBuffer::destroy();
FLOG_INFO("ObMdsEventBuffer destroyed");
@ -1045,11 +1036,6 @@ int ObServer::start()
}
FLOG_INFO("check if timezone usable", KR(ret), K(stop_), K(timezone_usable));
while (OB_SUCC(ret) && !stop_ && !tenant_srs_mgr_.is_sys_load_completed()) {
SLEEP(1);
}
LOG_INFO("[NOTICE] check if sys srs usable", K(ret), K(stop_));
// check log replay and user tenant schema refresh status
if (OB_SUCC(ret)) {
if (stop_) {
@ -1354,10 +1340,6 @@ int ObServer::stop()
//ObPartitionScheduler::get_instance().stop_merge();
//FLOG_INFO("partition scheduler stopped", KR(ret));
FLOG_INFO("begin to stop tenant srs manager");
tenant_srs_mgr_.stop();
FLOG_INFO("tenant srs manager stopped");
FLOG_INFO("begin to stop opt stat manager ");
ObOptStatManager::get_instance().stop();
FLOG_INFO("opt stat manager stopped");
@ -1647,10 +1629,6 @@ int ObServer::wait()
TG_WAIT(lib::TGDefIDs::DiskUseReport);
FLOG_INFO("wait disk usage report task success");
FLOG_INFO("begin to wait tenant srs manager");
tenant_srs_mgr_.wait();
FLOG_INFO("wait tenant srs manager success");
FLOG_INFO("begin to wait ob_server_block_mgr");
OB_SERVER_BLOCK_MGR.wait();
FLOG_INFO("wait ob_server_block_mgr success");
@ -1744,16 +1722,6 @@ int ObServer::init_tz_info_mgr()
return ret;
}
int ObServer::init_srs_mgr()
{
int ret = OB_SUCCESS;
if (OB_FAIL(tenant_srs_mgr_.init(&sql_proxy_, self_addr_, &schema_service_))) {
LOG_WARN("tenant_srs_mgr_ init failed", K_(self_addr), K(ret));
}
return ret;
}
int ObServer::init_config()
{
int ret = OB_SUCCESS;
@ -2005,6 +1973,8 @@ int ObServer::init_pre_setting()
int ret = OB_SUCCESS;
reset_mem_leak_checker_label(GCONF.leak_mod_to_check.str());
ObMallocSampleLimiter::set_interval(GCONF._max_malloc_sample_interval,
GCONF._min_malloc_sample_interval);
// oblog configuration
if (OB_SUCC(ret)) {
@ -2372,10 +2342,7 @@ int ObServer::init_global_kvcache()
{
int ret = OB_SUCCESS;
int64_t bucket_num = ObKVGlobalCache::get_instance().get_suitable_bucket_num();
int64_t max_cache_size = ObKVGlobalCache::DEFAULT_MAX_CACHE_SIZE;
if (is_mini_mode()) {
max_cache_size *= lib::mini_mode_resource_ratio();
}
const int64_t max_cache_size = MIN(sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE), ObKVGlobalCache::DEFAULT_MAX_CACHE_SIZE);
if (OB_FAIL(ObKVGlobalCache::get_instance().init(&ObTenantMemLimitGetter::get_instance(),
bucket_num,
max_cache_size))) {