[CP] add enable_dblink cfg

This commit is contained in:
cqliang1995 2024-01-23 12:12:39 +00:00 committed by ob-robot
parent 8cd6eac178
commit 2bd4ba144a
8 changed files with 25 additions and 1 deletions

View File

@ -39,6 +39,11 @@ bool __attribute__((weak)) get_dblink_reuse_connection_cfg()
return true;
}
bool __attribute__((weak)) get_enable_dblink_cfg()
{
return true;
}
namespace oceanbase
{
namespace common

View File

@ -16,6 +16,7 @@
#include "lib/ob_errno.h"
extern bool get_dblink_reuse_connection_cfg();
extern bool get_enable_dblink_cfg();
namespace oceanbase
{

View File

@ -441,7 +441,10 @@ int ObDbLinkProxy::create_dblink_pool(const dblink_param_ctx &param_ctx, const O
{
int ret = OB_SUCCESS;
ObISQLConnectionPool *dblink_pool = NULL;
if (!is_inited()) {
if (!get_enable_dblink_cfg()) {
ret = OB_OP_NOT_ALLOW;
LOG_WARN("dblink is disabled", K(ret));
} else if (!is_inited()) {
ret = OB_NOT_INIT;
LOG_WARN("mysql proxy not inited");
} else if (OB_FAIL(switch_dblink_conn_pool(param_ctx.link_type_, dblink_pool))) {

View File

@ -1616,6 +1616,9 @@ ERRSIM_DEF_STR(errsim_transfer_backfill_server_addr, OB_CLUSTER_PARAMETER, "",
DEF_BOOL(_ob_enable_direct_load, OB_CLUSTER_PARAMETER, "True",
"Enable or disable direct path load",
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_BOOL(enable_dblink, OB_CLUSTER_PARAMETER, "True",
"Enable or disable dblink",
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));
DEF_BOOL(_px_join_skew_handling, OB_TENANT_PARAMETER, "False",
"enables skew handling for parallel joins. The default value is True.",
ObParameterAttr(Section::OBSERVER, Source::DEFAULT, EditLevel::DYNAMIC_EFFECTIVE));

View File

@ -38,6 +38,11 @@ bool get_dblink_reuse_connection_cfg()
return tenant_config.is_valid() ? tenant_config->_enable_dblink_reuse_connection : true;
}
bool get_enable_dblink_cfg()
{
return GCONF.enable_dblink;
}
uint64_t ObDblinkService::get_current_tenant_id()
{
return MTL_ID();

View File

@ -43,6 +43,9 @@ int ObCreateDbLinkResolver::resolve(const ParseNode &parse_tree)
|| OB_UNLIKELY(node->num_child_ != DBLINK_NODE_COUNT)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("invalid parse tree", K(ret), KP(node), K(node->type_), K(T_CREATE_DBLINK), K(node->num_child_));
} else if (!GCONF.enable_dblink) {
ret = OB_OP_NOT_ALLOW;
LOG_WARN("dblink is disabled", K(ret));
} else if (OB_ISNULL(session_info_) || OB_ISNULL(schema_checker_)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("session info should not be null", K(ret));

View File

@ -43,6 +43,9 @@ int ObDropDbLinkResolver::resolve(const ParseNode &parse_tree)
|| OB_UNLIKELY(node->num_child_ != DBLINK_NODE_COUNT)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("invalid parse tree", K(ret));
} else if (!GCONF.enable_dblink) {
ret = OB_OP_NOT_ALLOW;
LOG_WARN("dblink is disabled", K(ret));
} else if (OB_ISNULL(session_info_)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("session info should not be null", K(ret));

View File

@ -79,6 +79,7 @@ dump_data_dictionary_to_log_interval
enable_async_syslog
enable_cgroup
enable_crazy_medium_compaction
enable_dblink
enable_ddl
enable_early_lock_release
enable_kv_ttl