[CP] implement dblink reuse connection cfg

This commit is contained in:
obdev
2024-02-09 22:59:11 +00:00
committed by ob-robot
parent f6681accc1
commit a34e69a914
7 changed files with 45 additions and 14 deletions

View File

@ -1679,7 +1679,9 @@ DEF_STR_WITH_CHECKER(rpc_server_authentication_method, OB_CLUSTER_PARAMETER, "AL
DEF_BOOL(_enable_backtrace_function, OB_CLUSTER_PARAMETER, "True",
"Decide whether to let the backtrace function take effect",
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_BOOL(_enable_dblink_reuse_connection, OB_TENANT_PARAMETER, "True",
"specifies whether dblink reuse connection in a session",
ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_INT(_with_subquery, OB_TENANT_PARAMETER, "0", "[0,2]",
"WITH subquery transformation,0: optimizer,1: materialize,2: inline",
ObParameterAttr(Section::TENANT, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));

View File

@ -30,6 +30,14 @@ using namespace oceanbase::sql;
using namespace oceanbase::share;
#ifdef OB_BUILD_DBLINK
bool get_dblink_reuse_connection_cfg()
{
omt::ObTenantConfigGuard tenant_config(TENANT_CONF(MTL_ID()));
// default value of _enable_dblink_reuse_connection is true, if !tenant_config.is_valid() return true
return tenant_config.is_valid() ? tenant_config->_enable_dblink_reuse_connection : true;
}
uint64_t ObDblinkService::get_current_tenant_id()
{
return MTL_ID();