[FEAT MERGE] merge transfer

Co-authored-by: wxhwang <wxhwang@126.com>
Co-authored-by: godyangfight <godyangfight@gmail.com>
Co-authored-by: Tyshawn <tuyunshan@gmail.com>
This commit is contained in:
xuhuleon
2023-06-21 11:42:26 +00:00
committed by ob-robot
parent d06678002e
commit 9dae112952
1280 changed files with 149724 additions and 48813 deletions

View File

@ -43,8 +43,6 @@
#include "rpc/obrpc/ob_rpc_handler.h"
#include "rpc/obrpc/ob_rpc_proxy.h"
#include "share/allocator/ob_tenant_mutil_allocator_mgr.h"
#include "share/backup/ob_backup_file_lock_mgr.h"
#include "share/backup/ob_backup_lease_info_mgr.h"
#include "share/cache/ob_cache_name_define.h"
#include "share/interrupt/ob_global_interrupt_call.h"
#include "share/ob_bg_thread_monitor.h"
@ -77,6 +75,7 @@
#include "storage/tx/ob_ts_mgr.h"
#include "storage/tx_table/ob_tx_data_cache.h"
#include "storage/ob_file_system_router.h"
#include "storage/ob_tablet_autoinc_seq_rpc_handler.h"
#include "common/log/ob_log_constants.h"
#include "share/stat/ob_opt_stat_monitor_manager.h"
#include "sql/engine/px/ob_px_target_mgr.h"
@ -94,14 +93,18 @@
#include "storage/ob_file_system_router.h"
#include "storage/blocksstable/ob_storage_cache_suite.h"
#include "storage/tablelock/ob_table_lock_rpc_client.h"
#include "storage/compaction/ob_compaction_diagnose.h"
#include "share/ash/ob_active_sess_hist_task.h"
#include "share/ash/ob_active_sess_hist_list.h"
#include "share/ob_server_blacklist.h"
#include "share/ob_primary_standby_service.h" // ObPrimaryStandbyService
#include "share/scheduler/ob_dag_warning_history_mgr.h"
#include "share/longops_mgr/ob_longops_mgr.h"
#include "logservice/palf/election/interface/election.h"
#include "storage/ddl/ob_ddl_redo_log_writer.h"
#include "observer/ob_server_utils.h"
#include "observer/table_load/ob_table_load_partition_calc.h"
#include "observer/virtual_table/ob_mds_event_buffer.h"
#include "share/detect/ob_detect_manager.h"
using namespace oceanbase::lib;
@ -267,6 +270,8 @@ int ObServer::init(const ObServerOptions &opts, const ObPLogWriterCfg &log_cfg)
if (FAILEDx(ObQueryRetryCtrl::init())) {
LOG_ERROR("init retry ctrl failed", KR(ret));
} else if (OB_FAIL(ObMdsEventBuffer::init())) {
LOG_WARN("init MDS event buffer failed", KR(ret));
} else if (OB_FAIL(ObTableApiProcessorBase::init_session())) {
LOG_ERROR("init static session failed", KR(ret));
} else if (OB_FAIL(init_loaddata_global_stat())) {
@ -385,8 +390,6 @@ int ObServer::init(const ObServerOptions &opts, const ObPLogWriterCfg &log_cfg)
LOG_ERROR("init refresh network speed task failed", KR(ret));
} else if (OB_FAIL(init_refresh_cpu_frequency())) {
LOG_ERROR("init refresh cpu frequency failed", KR(ret));
} else if (OB_FAIL(init_collect_info_gc_task())) {
LOG_ERROR("init collect info gc task failed", KR(ret));
} else if (OB_FAIL(ObOptStatManager::get_instance().init(
&sql_proxy_, &config_))) {
LOG_ERROR("init opt stat manager failed", KR(ret));
@ -407,18 +410,10 @@ int ObServer::init(const ObServerOptions &opts, const ObPLogWriterCfg &log_cfg)
LOG_ERROR("init timer monitor failed", KR(ret));
} else if (OB_FAIL(ObBGThreadMonitor::get_instance().init())) {
LOG_ERROR("init bg thread monitor failed", KR(ret));
} else if (OB_FAIL(ObBackupInfoMgr::get_instance().init(sql_proxy_))) {
LOG_ERROR("init ObBackupInfo failed", KR(ret));
} else if (OB_FAIL(ObPxBloomFilterManager::instance().init())) {
LOG_ERROR("init px blomm filter manager failed", KR(ret));
} else if (OB_FAIL(PX_P2P_DH.init())) {
LOG_ERROR("init px p2p datahub failed", KR(ret));
} else if (OB_FAIL(ObBackupFileLockMgr::get_instance().init())) {
LOG_ERROR("init backup file lock mgr failed", KR(ret));
} else if (OB_FAIL(ObDagWarningHistoryManager::get_instance().init())) {
LOG_ERROR("init dag warning history manager failed", KR(ret));
} else if (OB_FAIL(compaction::ObScheduleSuspectInfoMgr::get_instance().init())) {
LOG_ERROR("init ObScheduleSuspectInfoMgr failed", KR(ret));
} else if (OB_FAIL(compaction::ObCompactionSuggestionMgr::get_instance().init())) {
LOG_ERROR("init ObCompactionSuggestionMgr failed", KR(ret));
} else if (OB_FAIL(G_RES_MGR.init())) {
@ -499,14 +494,6 @@ void ObServer::destroy()
ObActiveSessHistTask::get_instance().destroy();
FLOG_INFO("active session history task destroyed");
FLOG_INFO("begin to destroy backup info");
ObBackupInfoMgr::get_instance().destroy();
FLOG_INFO("backup info destroyed");
FLOG_INFO("begin to destroy backup file lock mgr");
ObBackupFileLockMgr::get_instance().destroy();
FLOG_INFO("backup file lock mgr destroyed");
FLOG_INFO("begin to destroy timer monitor");
ObTimerMonitor::get_instance().destroy();
FLOG_INFO("timer monitor destroyed");
@ -621,14 +608,6 @@ void ObServer::destroy()
OB_TX_DATA_KV_CACHE.destroy();
FLOG_INFO("tx data kv cache destroyed");
FLOG_INFO("begin to destroy ObDagWarningHistoryManager");
ObDagWarningHistoryManager::get_instance().destroy();
FLOG_INFO("ObDagWarningHistoryManager destroyed");
FLOG_INFO("begin to destroy ObScheduleSuspectInfoMgr");
compaction::ObScheduleSuspectInfoMgr::get_instance().destroy();
FLOG_INFO("ObScheduleSuspectInfoMgr destroyed");
FLOG_INFO("begin to destroy location service");
location_service_.destroy();
FLOG_INFO("location service destroyed");
@ -669,6 +648,10 @@ void ObServer::destroy()
tenant_srs_mgr_.destroy();
FLOG_INFO("tenant srs manager destroyed");
FLOG_INFO("begin to destroy ObMdsEventBuffer");
ObMdsEventBuffer::destroy();
FLOG_INFO("ObMdsEventBuffer destroyed");
FLOG_INFO("begin to destroy query retry ctrl");
ObQueryRetryCtrl::destroy();
FLOG_INFO("query retry ctrl destroy");
@ -768,9 +751,9 @@ int ObServer::start()
}
if (FAILEDx(multi_tenant_.start())) {
LOG_ERROR("fail to start muti tenant", KR(ret));
LOG_ERROR("fail to start multi tenant", KR(ret));
} else {
FLOG_INFO("success to start muti tenant");
FLOG_INFO("success to start multi tenant");
}
if (FAILEDx(ObServerCheckpointSlogHandler::get_instance().start())) {
@ -779,6 +762,12 @@ int ObServer::start()
FLOG_INFO("success to start server checkpoint slog handler");
}
if (FAILEDx(ObServerCheckpointSlogHandler::enable_replay_clog())) {
LOG_ERROR("fail to enable replay clog", KR(ret));
} else {
FLOG_INFO("success to enable replay clog");
}
if (FAILEDx(log_block_mgr_.start(storage_env_.log_disk_size_))) {
LOG_ERROR("fail to start log pool", KR(ret));
} else {
@ -839,13 +828,6 @@ int ObServer::start()
} else {
FLOG_INFO("success to start bg thread monitor");
}
if (FAILEDx(ObBackupInfoMgr::get_instance().start())) {
LOG_ERROR("fail to start backup info", KR(ret));
} else {
FLOG_INFO("success to start backup info");
}
#ifdef ENABLE_IMC
if (FAILEDx(imc_tasks_.start())) {
LOG_ERROR("fail to start imc tasks", KR(ret));
@ -1091,10 +1073,6 @@ int ObServer::stop()
ObActiveSessHistTask::get_instance().stop();
FLOG_INFO("active session history task stopped");
FLOG_INFO("begin to stop backup info");
ObBackupInfoMgr::get_instance().stop();
FLOG_INFO("backup info stopped");
FLOG_INFO("begin to stop table store stat mgr");
ObTableStoreStatMgr::get_instance().stop();
FLOG_INFO("table store stat mgr stopped");
@ -1448,10 +1426,6 @@ int ObServer::wait()
root_service_monitor_.wait();
FLOG_INFO("wait root service monitor success");
FLOG_INFO("begin to wait backup info");
ObBackupInfoMgr::get_instance().wait();
FLOG_INFO("wait backup info success");
//omt
FLOG_INFO("begin to wait multi tenant");
multi_tenant_.wait();
@ -2002,6 +1976,7 @@ int ObServer::init_io()
storage_env_.user_row_cache_priority_ = config_.user_row_cache_priority;
storage_env_.fuse_row_cache_priority_ = config_.fuse_row_cache_priority;
storage_env_.bf_cache_priority_ = config_.bf_cache_priority;
storage_env_.storage_meta_cache_priority_ = config_.storage_meta_cache_priority;
storage_env_.bf_cache_miss_count_threshold_ = config_.bf_cache_miss_count_threshold;
// policy
@ -2511,7 +2486,8 @@ int ObServer::init_storage()
storage_env_.user_row_cache_priority_,
storage_env_.fuse_row_cache_priority_,
storage_env_.bf_cache_priority_,
storage_env_.bf_cache_miss_count_threshold_))) {
storage_env_.bf_cache_miss_count_threshold_,
storage_env_.storage_meta_cache_priority_))) {
LOG_WARN("Fail to init OB_STORE_CACHE, ", KR(ret), K(storage_env_.data_dir_));
} else if (OB_FAIL(ObTmpFileManager::get_instance().init())) {
LOG_WARN("fail to init temp file manager", KR(ret));
@ -2739,7 +2715,8 @@ int ObServer::reload_config()
GCONF.user_block_cache_priority,
GCONF.user_row_cache_priority,
GCONF.fuse_row_cache_priority,
GCONF.bf_cache_priority))) {
GCONF.bf_cache_priority,
GCONF.storage_meta_cache_priority))) {
LOG_WARN("set cache priority fail, ", KR(ret));
} else if (OB_FAIL(reload_bandwidth_throttle_limit(ethernet_speed_))) {
LOG_WARN("failed to reload_bandwidth_throttle_limit", KR(ret));
@ -3138,17 +3115,6 @@ int ObServer::refresh_cpu_frequency()
return ret;
}
void ObServer::ObCollectInfoGCTask::runTimerTask()
{
int ret = OB_SUCCESS;
int64_t cost_ts = ObTimeUtility::fast_current_time();
if (OB_FAIL(compaction::ObScheduleSuspectInfoMgr::get_instance().gc_info())) {
LOG_WARN("Fail to gc collect info", K(ret));
}
cost_ts = ObTimeUtility::fast_current_time() - cost_ts;
LOG_INFO("ObCollectInfoGCTask", K(cost_ts));
}
int ObServer::refresh_network_speed()
{
int ret = OB_SUCCESS;
@ -3227,15 +3193,6 @@ int ObServer::init_refresh_cpu_frequency()
return ret;
}
int ObServer::init_collect_info_gc_task()
{
int ret = OB_SUCCESS;
if (OB_FAIL(TG_SCHEDULE(lib::TGDefIDs::ServerGTimer, collect_info_gc_task_, ObCollectInfoGCTask::COLLECT_INFO_GC_INTERVAL, true /*schedule repeatly*/))) {
LOG_ERROR("fail to schedule task ObCollectInfoGCTask", KR(ret));
}
return ret;
}
// @@Query cleanup rules for built tables and temporary tables:
//1, Traverse all table_schema, if the session_id of table T <> 0 means that the table is being created or the previous creation failed or the temporary table is to be cleared, then enter 2#;
//2, Create a table for the query: traverse the session, and determine whether T should be DROP according to the session_id and time of the session and table T;