提交 5738f6e9 编写于 作者: C cqliang1995 提交者: ob-robot

add _max_dblink_conn_per_observer cfg.

上级 20d9e216
...@@ -44,6 +44,11 @@ bool __attribute__((weak)) get_enable_dblink_cfg() ...@@ -44,6 +44,11 @@ bool __attribute__((weak)) get_enable_dblink_cfg()
return true; return true;
} }
uint64_t __attribute__((weak)) get_max_dblink_conn_per_observer()
{
return 256;
}
namespace oceanbase namespace oceanbase
{ {
namespace common namespace common
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
extern bool get_dblink_reuse_connection_cfg(); extern bool get_dblink_reuse_connection_cfg();
extern bool get_enable_dblink_cfg(); extern bool get_enable_dblink_cfg();
extern uint64_t get_max_dblink_conn_per_observer();
namespace oceanbase namespace oceanbase
{ {
......
...@@ -210,6 +210,7 @@ int ObServerConnectionPool::init_dblink(uint64_t tenant_id, uint64_t dblink_id, ...@@ -210,6 +210,7 @@ int ObServerConnectionPool::init_dblink(uint64_t tenant_id, uint64_t dblink_id,
ObMySQLConnectionPool *root, int64_t max_allowed_conn_count) ObMySQLConnectionPool *root, int64_t max_allowed_conn_count)
{ {
UNUSED(conn_str); UNUSED(conn_str);
UNUSED(max_allowed_conn_count);
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
if (OB_ISNULL(root)) { if (OB_ISNULL(root)) {
ret = OB_INVALID_ARGUMENT; ret = OB_INVALID_ARGUMENT;
...@@ -236,7 +237,7 @@ int ObServerConnectionPool::init_dblink(uint64_t tenant_id, uint64_t dblink_id, ...@@ -236,7 +237,7 @@ int ObServerConnectionPool::init_dblink(uint64_t tenant_id, uint64_t dblink_id,
root_ = root; root_ = root;
last_renew_timestamp_ = ::oceanbase::common::ObTimeUtility::current_time(); last_renew_timestamp_ = ::oceanbase::common::ObTimeUtility::current_time();
server_not_available_ = false; server_not_available_ = false;
max_allowed_conn_count_ = max_allowed_conn_count; max_allowed_conn_count_ = get_max_dblink_conn_per_observer();
connection_pool_ptr_ = &dblink_connection_pool_; connection_pool_ptr_ = &dblink_connection_pool_;
if (cluster_str.empty()) { if (cluster_str.empty()) {
(void)snprintf(db_user_, sizeof(db_user_), "%.*s@%.*s", db_user.length(), db_user.ptr(), (void)snprintf(db_user_, sizeof(db_user_), "%.*s@%.*s", db_user.length(), db_user.ptr(),
......
...@@ -1667,7 +1667,9 @@ DEF_BOOL(_enable_dblink_reuse_connection, OB_TENANT_PARAMETER, "True", ...@@ -1667,7 +1667,9 @@ DEF_BOOL(_enable_dblink_reuse_connection, OB_TENANT_PARAMETER, "True",
DEF_INT(_with_subquery, OB_TENANT_PARAMETER, "0", "[0,2]", DEF_INT(_with_subquery, OB_TENANT_PARAMETER, "0", "[0,2]",
"WITH subquery transformation,0: optimizer,1: materialize,2: inline", "WITH subquery transformation,0: optimizer,1: materialize,2: inline",
ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE)); ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_INT(_max_dblink_conn_per_observer, OB_TENANT_PARAMETER, "256", "[0,)",
"The maximum limit on the number of connections that can be opened simultaneously for a specific observer for any DBLink, default value is 256",
ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_BOOL(_xsolapi_generate_with_clause, OB_TENANT_PARAMETER, "True", DEF_BOOL(_xsolapi_generate_with_clause, OB_TENANT_PARAMETER, "True",
"OLAP API generates WITH clause", "OLAP API generates WITH clause",
ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE)); ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
......
...@@ -43,6 +43,12 @@ bool get_enable_dblink_cfg() ...@@ -43,6 +43,12 @@ bool get_enable_dblink_cfg()
return GCONF.enable_dblink; return GCONF.enable_dblink;
} }
uint64_t get_max_dblink_conn_per_observer()
{
omt::ObTenantConfigGuard tenant_config(TENANT_CONF(MTL_ID()));
return tenant_config.is_valid() ? tenant_config->_max_dblink_conn_per_observer : 256;
}
uint64_t ObDblinkService::get_current_tenant_id() uint64_t ObDblinkService::get_current_tenant_id()
{ {
return MTL_ID(); return MTL_ID();
......
...@@ -341,6 +341,7 @@ _load_tde_encrypt_engine ...@@ -341,6 +341,7 @@ _load_tde_encrypt_engine
_log_writer_parallelism _log_writer_parallelism
_ls_gc_wait_readonly_tx_time _ls_gc_wait_readonly_tx_time
_ls_migration_wait_completing_timeout _ls_migration_wait_completing_timeout
_max_dblink_conn_per_observer
_max_elr_dependent_trx_count _max_elr_dependent_trx_count
_max_ls_cnt_per_server _max_ls_cnt_per_server
_max_malloc_sample_interval _max_malloc_sample_interval
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册