Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cd662421
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cd662421
编写于
5月 03, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-150] deadlock in balance
上级
19895e9b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
53 addition
and
55 deletion
+53
-55
src/inc/tbalance.h
src/inc/tbalance.h
+1
-0
src/mnode/src/mgmtBalance.c
src/mnode/src/mgmtBalance.c
+1
-0
src/mnode/src/mgmtDnode.c
src/mnode/src/mgmtDnode.c
+1
-0
tests/script/unique/dnode/balance1.sim
tests/script/unique/dnode/balance1.sim
+50
-55
未找到文件。
src/inc/tbalance.h
浏览文件 @
cd662421
...
...
@@ -26,6 +26,7 @@ struct SDnodeObj;
int32_t
balanceInit
();
void
balanceCleanUp
();
void
balanceNotify
();
void
balanceUpdateMgmt
();
void
balanceReset
();
int32_t
balanceAllocVnodes
(
struct
SVgObj
*
pVgroup
);
int32_t
balanceDropDnode
(
struct
SDnodeObj
*
pDnode
);
...
...
src/mnode/src/mgmtBalance.c
浏览文件 @
cd662421
...
...
@@ -29,6 +29,7 @@
int32_t
balanceInit
()
{
return
TSDB_CODE_SUCCESS
;
}
void
balanceCleanUp
()
{}
void
balanceNotify
()
{}
void
balanceUpdateMgmt
()
{}
void
balanceReset
()
{}
int32_t
balanceAllocVnodes
(
SVgObj
*
pVgroup
)
{
...
...
src/mnode/src/mgmtDnode.c
浏览文件 @
cd662421
...
...
@@ -322,6 +322,7 @@ void mgmtProcessDnodeStatusMsg(SRpcMsg *rpcMsg) {
if
(
pDnode
->
status
==
TAOS_DN_STATUS_OFFLINE
)
{
mTrace
(
"dnode:%d, from offline to online"
,
pDnode
->
dnodeId
);
pDnode
->
status
=
TAOS_DN_STATUS_READY
;
balanceUpdateMgmt
();
balanceNotify
();
}
...
...
tests/script/unique/dnode/balance1.sim
浏览文件 @
cd662421
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
...
...
@@ -49,8 +44,8 @@ sql insert into d1.t1 values(now+4s, 12)
sql insert into d1.t1 values(now+5s, 11)
sql show dnodes
print dnode1 openVnodes $data
3
_1
if $data
3
_1 != 1 then
print dnode1 openVnodes $data
2
_1
if $data
2
_1 != 1 then
return -1
endi
...
...
@@ -68,12 +63,12 @@ show2:
endi
sql show dnodes
print dnode1 openVnodes $data
3
_1
print dnode2 openVnodes $data
3
_2
if $data
3
_1 != 0 then
print dnode1 openVnodes $data
2
_1
print dnode2 openVnodes $data
2
_2
if $data
2
_1 != 0 then
goto show2
endi
if $data
3
_2 != 1 then
if $data
2
_2 != 1 then
goto show2
endi
...
...
@@ -87,12 +82,12 @@ sql insert into d2.t2 values(now+4s, 22)
sql insert into d2.t2 values(now+5s, 21)
sql show dnodes
print dnode1 openVnodes $data
3
_1
print dnode2 openVnodes $data
3
_2
if $data
3
_1 != 0 then
print dnode1 openVnodes $data
2
_1
print dnode2 openVnodes $data
2
_2
if $data
2
_1 != 0 then
return -1
endi
if $data
3
_2 != 2 then
if $data
2
_2 != 2 then
return -1
endi
...
...
@@ -108,12 +103,12 @@ show4:
endi
sql show dnodes
print dnode1 openVnodes $data
3
_1
print dnode2 openVnodes $data
3
_2
if $data
3
_1 != 2 then
print dnode1 openVnodes $data
2
_1
print dnode2 openVnodes $data
2
_2
if $data
2
_1 != 2 then
goto show4
endi
if $data
3
_2 != null then
if $data
2
_2 != null then
goto show4
endi
if $rows != 1 then
...
...
@@ -135,16 +130,16 @@ show5:
endi
sql show dnodes
print dnode1 openVnodes $data
3
_1
print dnode2 openVnodes $data
3
_2
print dnode3 openVnodes $data
3
_3
if $data
3
_1 != 0 then
print dnode1 openVnodes $data
2
_1
print dnode2 openVnodes $data
2
_2
print dnode3 openVnodes $data
2
_3
if $data
2
_1 != 0 then
goto show5
endi
if $data
3
_2 != null then
if $data
2
_2 != null then
goto show5
endi
if $data
3
_3 != 2 then
if $data
2
_3 != 2 then
goto show5
endi
...
...
@@ -158,17 +153,17 @@ sql insert into d3.t3 values(now+4s, 32)
sql insert into d3.t3 values(now+5s, 31)
sql show dnodes
print dnode1 openVnodes $data
3
_1
print dnode2 openVnodes $data
3
_2
print dnode3 openVnodes $data
3
_3
print dnode1 openVnodes $data
2
_1
print dnode2 openVnodes $data
2
_2
print dnode3 openVnodes $data
2
_3
if $data
3
_1 != 0 then
if $data
2
_1 != 0 then
return -1
endi
if $data
3
_2 != null then
if $data
2
_2 != null then
return -1
endi
if $data
3
_3 != 3 then
if $data
2
_3 != 3 then
return -1
endi
...
...
@@ -185,20 +180,20 @@ show7:
endi
sql show dnodes
print dnode1 openVnodes $data
3
_1
print dnode2 openVnodes $data
3
_2
print dnode3 openVnodes $data
3
_3
print dnode4 openVnodes $data
3
_4
if $data
3
_1 != 0 then
print dnode1 openVnodes $data
2
_1
print dnode2 openVnodes $data
2
_2
print dnode3 openVnodes $data
2
_3
print dnode4 openVnodes $data
2
_4
if $data
2
_1 != 0 then
goto show7
endi
if $data
3
_2 != null then
if $data
2
_2 != null then
goto show7
endi
if $data
3
_3 != 2 then
if $data
2
_3 != 2 then
goto show7
endi
if $data
3
_4 != 1 then
if $data
2
_4 != 1 then
goto show7
endi
...
...
@@ -212,21 +207,21 @@ sql insert into d4.t4 values(now+4s, 42)
sql insert into d4.t4 values(now+5s, 41)
sql show dnodes
print dnode1 openVnodes $data
3
_1
print dnode2 openVnodes $data
3
_2
print dnode3 openVnodes $data
3
_3
print dnode4 openVnodes $data
3
_4
print dnode1 openVnodes $data
2
_1
print dnode2 openVnodes $data
2
_2
print dnode3 openVnodes $data
2
_3
print dnode4 openVnodes $data
2
_4
if $data
3
_1 != 0 then
if $data
2
_1 != 0 then
return -1
endi
if $data
3
_2 != null then
if $data
2
_2 != null then
return -1
endi
if $data
3
_3 != 2 then
if $data
2
_3 != 2 then
return -1
endi
if $data
3
_4 != 2 then
if $data
2
_4 != 2 then
return -1
endi
...
...
@@ -242,21 +237,21 @@ show9:
endi
sql show dnodes
print dnode1 openVnodes $data
3
_1
print dnode2 openVnodes $data
3
_2
print dnode3 openVnodes $data
3
_3
print dnode4 openVnodes $data
3
_4
print dnode1 openVnodes $data
2
_1
print dnode2 openVnodes $data
2
_2
print dnode3 openVnodes $data
2
_3
print dnode4 openVnodes $data
2
_4
if $data
3
_1 != 0 then
if $data
2
_1 != 0 then
goto show9
endi
if $data
3
_2 != null then
if $data
2
_2 != null then
goto show9
endi
if $data
3
_3 != null then
if $data
2
_3 != null then
goto show9
endi
if $data
3
_4 != 4 then
if $data
2
_4 != 4 then
goto show9
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录