[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))) {