Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
oceanbase
提交
bfd3dcef
O
oceanbase
项目概览
oceanbase
/
oceanbase
9 个月 前同步成功
通知
261
Star
6084
Fork
1301
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
bfd3dcef
编写于
11月 28, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
11月 28, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix mysqltest case
上级
1ec3baa3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
10 deletion
+19
-10
deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.cpp
deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.cpp
+18
-10
deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.h
deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.h
+1
-0
未找到文件。
deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.cpp
浏览文件 @
bfd3dcef
...
...
@@ -93,6 +93,7 @@ ObMySQLConnectionPool::ObMySQLConnectionPool()
busy_conn_count_
(
0
),
config_
(),
get_lock_
(
obsys
::
WRITE_PRIORITY
),
dblink_pool_lock_
(
obsys
::
WRITE_PRIORITY
),
allocator_
(
ObModIds
::
OB_SQL_CONNECTION_POOL
),
server_list_
(
allocator_
),
tenant_server_pool_map_
(),
...
...
@@ -762,17 +763,24 @@ int ObMySQLConnectionPool::create_dblink_pool(uint64_t tenant_id, uint64_t dblin
LOG_WARN
(
"fail to get dblink connection pool"
,
K
(
dblink_id
));
}
else
if
(
OB_NOT_NULL
(
dblink_pool
))
{
// nothing.
}
else
if
(
OB_ISNULL
(
dblink_pool
=
server_pool_
.
alloc
()))
{
ret
=
OB_ALLOCATE_MEMORY_FAILED
;
LOG_ERROR
(
"out of memory"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
dblink_pool
->
init_dblink
(
dblink_id
,
server
,
db_tenant
,
db_user
,
db_pass
,
db_name
,
conn_str
,
cluster_str
,
this
,
config_
.
sqlclient_per_observer_conn_limit_
)))
{
LOG_WARN
(
"fail to init dblink connection pool"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
server_list_
.
push_back
(
dblink_pool
)))
{
LOG_WARN
(
"fail to push pool to list"
,
K
(
ret
));
}
else
{
LOG_INFO
(
"new dblink pool created"
,
K
(
server
),
K
(
config_
.
sqlclient_per_observer_conn_limit_
));
obsys
::
ObWLockGuard
lock
(
dblink_pool_lock_
);
if
(
OB_FAIL
(
get_dblink_pool
(
dblink_id
,
dblink_pool
)))
{
LOG_WARN
(
"fail to get dblink connection pool"
,
K
(
dblink_id
));
}
else
if
(
OB_NOT_NULL
(
dblink_pool
))
{
// nothing.
}
else
if
(
OB_ISNULL
(
dblink_pool
=
server_pool_
.
alloc
()))
{
ret
=
OB_ALLOCATE_MEMORY_FAILED
;
LOG_ERROR
(
"out of memory"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
dblink_pool
->
init_dblink
(
dblink_id
,
server
,
db_tenant
,
db_user
,
db_pass
,
db_name
,
conn_str
,
cluster_str
,
this
,
config_
.
sqlclient_per_observer_conn_limit_
)))
{
LOG_WARN
(
"fail to init dblink connection pool"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
server_list_
.
push_back
(
dblink_pool
)))
{
LOG_WARN
(
"fail to push pool to list"
,
K
(
ret
));
}
else
{
LOG_INFO
(
"new dblink pool created"
,
K
(
server
),
K
(
config_
.
sqlclient_per_observer_conn_limit_
));
}
}
if
(
OB_FAIL
(
ret
)
&&
OB_NOT_NULL
(
dblink_pool
))
{
server_pool_
.
free
(
dblink_pool
);
// put back to cache. prevent memory leak
...
...
deps/oblib/src/lib/mysqlclient/ob_mysql_connection_pool.h
浏览文件 @
bfd3dcef
...
...
@@ -225,6 +225,7 @@ protected:
char
init_sql_
[
OB_MAX_SQL_LENGTH
];
ObConnPoolConfigParam
config_
;
mutable
obsys
::
ObRWLock
get_lock_
;
mutable
obsys
::
ObRWLock
dblink_pool_lock_
;
common
::
ObArenaAllocator
allocator_
;
ServerList
server_list_
;
TenantServerConnMap
tenant_server_pool_map_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录