Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
XKZJ_WCL
TDengine
提交
4d31756c
T
TDengine
项目概览
XKZJ_WCL
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
4d31756c
编写于
4月 27, 2020
作者:
S
slguan
提交者:
GitHub
4月 27, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1729 from taosdata/feature/web
Feature/web
上级
905e2820
a257c678
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
131 addition
and
71 deletion
+131
-71
src/mnode/src/mgmtBalance.c
src/mnode/src/mgmtBalance.c
+5
-1
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+1
-1
tests/script/sh/deploy.sh
tests/script/sh/deploy.sh
+2
-1
tests/script/tmp/prepare.sim
tests/script/tmp/prepare.sim
+27
-1
tests/script/unique/db/commit.sim
tests/script/unique/db/commit.sim
+3
-3
tests/script/unique/db/delete.sim
tests/script/unique/db/delete.sim
+3
-3
tests/script/unique/db/delete_part.sim
tests/script/unique/db/delete_part.sim
+4
-4
tests/script/unique/db/replica_add12.sim
tests/script/unique/db/replica_add12.sim
+63
-34
tests/script/unique/db/replica_add13.sim
tests/script/unique/db/replica_add13.sim
+4
-4
tests/script/unique/db/replica_add23.sim
tests/script/unique/db/replica_add23.sim
+4
-4
tests/script/unique/db/replica_part.sim
tests/script/unique/db/replica_part.sim
+6
-6
tests/script/unique/db/replica_reduce21.sim
tests/script/unique/db/replica_reduce21.sim
+3
-3
tests/script/unique/db/replica_reduce31.sim
tests/script/unique/db/replica_reduce31.sim
+3
-3
tests/script/unique/db/replica_reduce32.sim
tests/script/unique/db/replica_reduce32.sim
+3
-3
未找到文件。
src/mnode/src/mgmtBalance.c
浏览文件 @
4d31756c
...
...
@@ -17,6 +17,7 @@
#include "os.h"
#include "trpc.h"
#include "tbalance.h"
#include "tglobal.h"
#include "mgmtDef.h"
#include "mgmtLog.h"
#include "mgmtMnode.h"
...
...
@@ -41,7 +42,10 @@ int32_t balanceAllocVnodes(SVgObj *pVgroup) {
if
(
pDnode
==
NULL
)
break
;
if
(
pDnode
->
totalVnodes
>
0
&&
pDnode
->
openVnodes
<
pDnode
->
totalVnodes
)
{
float
usage
=
(
float
)
pDnode
->
openVnodes
/
pDnode
->
totalVnodes
;
float
openVnodes
=
pDnode
->
openVnodes
;
if
(
pDnode
->
isMgmt
)
openVnodes
+=
tsMgmtEqualVnodeNum
;
float
usage
=
openVnodes
/
pDnode
->
totalVnodes
;
if
(
usage
<=
vnodeUsage
)
{
pSelDnode
=
pDnode
;
vnodeUsage
=
usage
;
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
4d31756c
...
...
@@ -286,7 +286,7 @@ void *vnodeGetVnode(int32_t vgId) {
SVnodeObj
**
ppVnode
=
(
SVnodeObj
**
)
taosGetIntHashData
(
tsDnodeVnodesHash
,
vgId
);
if
(
ppVnode
==
NULL
||
*
ppVnode
==
NULL
)
{
terrno
=
TSDB_CODE_INVALID_VGROUP_ID
;
d
Error
(
"vgId:%d not exist"
,
vgId
);
d
Print
(
"vgId:%d not exist"
,
vgId
);
return
NULL
;
}
...
...
tests/script/sh/deploy.sh
浏览文件 @
4d31756c
...
...
@@ -93,7 +93,7 @@ echo "privateIp $NODE_IP" >> $TAOS_CFG
echo
"dDebugFlag 199"
>>
$TAOS_CFG
echo
"mDebugFlag 199"
>>
$TAOS_CFG
echo
"sdbDebugFlag 199"
>>
$TAOS_CFG
echo
"rpcDebugFlag 13
1
"
>>
$TAOS_CFG
echo
"rpcDebugFlag 13
5
"
>>
$TAOS_CFG
echo
"tmrDebugFlag 131"
>>
$TAOS_CFG
echo
"cDebugFlag 135"
>>
$TAOS_CFG
echo
"httpDebugFlag 135"
>>
$TAOS_CFG
...
...
@@ -101,6 +101,7 @@ echo "monitorDebugFlag 131" >> $TAOS_CFG
echo
"udebugFlag 131"
>>
$TAOS_CFG
echo
"jnidebugFlag 131"
>>
$TAOS_CFG
echo
"monitor 0"
>>
$TAOS_CFG
echo
"http 0"
>>
$TAOS_CFG
echo
"numOfThreadsPerCore 2.0"
>>
$TAOS_CFG
echo
"defaultPass taosdata"
>>
$TAOS_CFG
echo
"numOfLogLines 100000000"
>>
$TAOS_CFG
...
...
tests/script/tmp/prepare.sim
浏览文件 @
4d31756c
system sh/stop_dnodes.sh
system sh/ip.sh -i 1 -s up
system sh/ip.sh -i 2 -s up
system sh/ip.sh -i 3 -s up
system sh/ip.sh -i 4 -s up
system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
\ No newline at end of file
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/deploy.sh -n dnode4 -m 192.168.0.1 -i 192.168.0.4
system sh/cfg.sh -n dnode1 -c commitLog -v 2
system sh/cfg.sh -n dnode2 -c commitLog -v 2
system sh/cfg.sh -n dnode3 -c commitLog -v 2
system sh/cfg.sh -n dnode4 -c commitLog -v 2
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode4 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
\ No newline at end of file
tests/script/unique/db/commit.sim
浏览文件 @
4d31756c
...
...
@@ -6,9 +6,9 @@ system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/cfg.sh -n dnode1 -c commitLog -v
0
system sh/cfg.sh -n dnode2 -c commitLog -v
0
system sh/cfg.sh -n dnode3 -c commitLog -v
0
system sh/cfg.sh -n dnode1 -c commitLog -v
2
system sh/cfg.sh -n dnode2 -c commitLog -v
2
system sh/cfg.sh -n dnode3 -c commitLog -v
2
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 1
...
...
tests/script/unique/db/delete.sim
浏览文件 @
4d31756c
...
...
@@ -6,9 +6,9 @@ system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/cfg.sh -n dnode1 -c clog -v
0
system sh/cfg.sh -n dnode2 -c clog -v
0
system sh/cfg.sh -n dnode3 -c clog -v
0
system sh/cfg.sh -n dnode1 -c clog -v
2
system sh/cfg.sh -n dnode2 -c clog -v
2
system sh/cfg.sh -n dnode3 -c clog -v
2
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 3
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 3
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 3
...
...
tests/script/unique/db/delete_part.sim
浏览文件 @
4d31756c
...
...
@@ -9,10 +9,10 @@ system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/deploy.sh -n dnode4 -m 192.168.0.1 -i 192.168.0.4
system sh/cfg.sh -n dnode1 -c c
ommitLog -v 0
system sh/cfg.sh -n dnode2 -c c
ommitLog -v 0
system sh/cfg.sh -n dnode3 -c c
ommitLog -v 0
system sh/cfg.sh -n dnode4 -c c
ommitLog -v 0
system sh/cfg.sh -n dnode1 -c c
log -v 2
system sh/cfg.sh -n dnode2 -c c
log -v 2
system sh/cfg.sh -n dnode3 -c c
log -v 2
system sh/cfg.sh -n dnode4 -c c
log -v 2
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
...
...
tests/script/unique/db/replica_add12.sim
浏览文件 @
4d31756c
...
...
@@ -9,10 +9,10 @@ system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/deploy.sh -n dnode4 -m 192.168.0.1 -i 192.168.0.4
system sh/cfg.sh -n dnode1 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode2 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode3 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode4 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode1 -c c
log -v 2
system sh/cfg.sh -n dnode2 -c c
log -v 2
system sh/cfg.sh -n dnode3 -c c
log -v 2
system sh/cfg.sh -n dnode4 -c c
log -v 2
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
...
...
@@ -30,12 +30,12 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
system sh/exec
_up
.sh -n dnode1 -s start
sql connect
sql create dnode 192.168.0.2
system sh/exec.sh -n dnode2 -s start
system sh/exec
_up
.sh -n dnode2 -s start
sql create dnode 192.168.0.3
system sh/exec.sh -n dnode3 -s start
system sh/exec
_up
.sh -n dnode3 -s start
sleep 3000
print ======== step1
...
...
@@ -76,41 +76,47 @@ endi
sleep 2000
sql show dnodes
print dnode192.168.0.1 ==> openVnodes: $data3_1
print dnode192.168.0.2 ==> openVnodes: $data3_2
print dnode192.168.0.3 ==> openVnodes: $data3_3
if $data3_1 != 0 then
return -1
endi
if $data3_2 != 2 then
return -1
endi
if $data3_3 != 2 then
return -1
endi
print ======== step2
sql alter database d1 replica 2
sql alter database d2 replica 2
sql alter database d3 replica 2
sql alter database d4 replica 2
sleep
22
000
sleep
10
000
print ======== step3
$x = 0
show3:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode192.168.0.1 ==> openVnodes: $data
2_192.168.0.1 freeVnodes: $data3_192.168.0.
1
print dnode192.168.0.2 ==> openVnodes: $data
2_192.168.0.2 freeVnodes: $data3_192.168.0.
2
print dnode192.168.0.3 ==> openVnodes: $data
2_192.168.0.3 freeVnodes: $data3_192.168.0.
3
print dnode192.168.0.1 ==> openVnodes: $data
3_
1
print dnode192.168.0.2 ==> openVnodes: $data
3_
2
print dnode192.168.0.3 ==> openVnodes: $data
3_
3
if $data
2_192.168.0.
1 != 0 then
goto show3
if $data
3_
1 != 0 then
return -1
endi
if $data3_
192.168.0.1
!= 4 then
goto show3
if $data3_
2
!= 4 then
return -1
endi
if $data3_192.168.0.2 != 0 then
goto show3
endi
if $data3_192.168.0.3 != 0 then
goto show3
if $data3_3 != 4 then
return -1
endi
print ======== step4
...
...
@@ -139,11 +145,34 @@ if $rows != 2 then
return -1
endi
sleep 2000
0
sleep 2000
print ========= step5
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec
_up
.sh -n dnode2 -s stop -x SIGINT
sleep 5000
sql select * from d1.t1
if $rows != 2 then
return -1
endi
sql select * from d2.t2
if $rows != 2 then
return -1
endi
sql select * from d3.t3
if $rows != 2 then
return -1
endi
sql select * from d4.t4
if $rows != 2 then
return -1
endi
print ===== insert data
sql insert into d1.t1 values(now, 3)
sql insert into d2.t2 values(now, 3)
sql insert into d3.t3 values(now, 3)
...
...
@@ -170,9 +199,9 @@ if $rows != 3 then
endi
print ========= step6
system sh/exec.sh -n dnode2 -s start
system sh/exec
_up
.sh -n dnode2 -s start
sleep 10000
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec
_up
.sh -n dnode3 -s stop -x SIGINT
sleep 10000
sql insert into d1.t1 values(now, 4)
...
...
@@ -201,9 +230,9 @@ if $rows != 4 then
endi
print ========= step7
system sh/exec.sh -n dnode3 -s start
system sh/exec
_up
.sh -n dnode3 -s start
sleep 10000
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec
_up
.sh -n dnode2 -s stop -x SIGINT
sleep 10000
sql insert into d1.t1 values(now, 5)
...
...
tests/script/unique/db/replica_add13.sim
浏览文件 @
4d31756c
...
...
@@ -9,10 +9,10 @@ system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/deploy.sh -n dnode4 -m 192.168.0.1 -i 192.168.0.4
system sh/cfg.sh -n dnode1 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode2 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode3 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode4 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode1 -c c
log -v 2
system sh/cfg.sh -n dnode2 -c c
log -v 2
system sh/cfg.sh -n dnode3 -c c
log -v 2
system sh/cfg.sh -n dnode4 -c c
log -v 2
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
...
...
tests/script/unique/db/replica_add23.sim
浏览文件 @
4d31756c
...
...
@@ -9,10 +9,10 @@ system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/deploy.sh -n dnode4 -m 192.168.0.1 -i 192.168.0.4
system sh/cfg.sh -n dnode1 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode2 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode3 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode4 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode1 -c c
log -v 2
system sh/cfg.sh -n dnode2 -c c
log -v 2
system sh/cfg.sh -n dnode3 -c c
log -v 2
system sh/cfg.sh -n dnode4 -c c
log -v 2
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
...
...
tests/script/unique/db/replica_part.sim
浏览文件 @
4d31756c
...
...
@@ -6,12 +6,12 @@ system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/cfg.sh -n dnode1 -c c
ommitLog -v 0
system sh/cfg.sh -n dnode2 -c c
ommitLog -v 0
system sh/cfg.sh -n dnode3 -c c
ommitLog -v 0
system sh/cfg.sh -n dnode1 -c numOfMPeers -v
1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v
1
system sh/cfg.sh -n dnode3 -c numOfMPeers -v
1
system sh/cfg.sh -n dnode1 -c c
log -v 2
system sh/cfg.sh -n dnode2 -c c
log -v 2
system sh/cfg.sh -n dnode3 -c c
log -v 2
system sh/cfg.sh -n dnode1 -c numOfMPeers -v
2
system sh/cfg.sh -n dnode2 -c numOfMPeers -v
2
system sh/cfg.sh -n dnode3 -c numOfMPeers -v
2
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 4
...
...
tests/script/unique/db/replica_reduce21.sim
浏览文件 @
4d31756c
...
...
@@ -6,9 +6,9 @@ system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/cfg.sh -n dnode1 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode2 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode3 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode1 -c c
log -v 2
system sh/cfg.sh -n dnode2 -c c
log -v 2
system sh/cfg.sh -n dnode3 -c c
log -v 2
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 1
...
...
tests/script/unique/db/replica_reduce31.sim
浏览文件 @
4d31756c
...
...
@@ -6,9 +6,9 @@ system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/cfg.sh -n dnode1 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode2 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode3 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode1 -c c
log -v 2
system sh/cfg.sh -n dnode2 -c c
log -v 2
system sh/cfg.sh -n dnode3 -c c
log -v 2
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 1
...
...
tests/script/unique/db/replica_reduce32.sim
浏览文件 @
4d31756c
...
...
@@ -6,9 +6,9 @@ system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1
system sh/deploy.sh -n dnode2 -m 192.168.0.1 -i 192.168.0.2
system sh/deploy.sh -n dnode3 -m 192.168.0.1 -i 192.168.0.3
system sh/cfg.sh -n dnode1 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode2 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode3 -c c
ommitLog -v 1
system sh/cfg.sh -n dnode1 -c c
log -v 2
system sh/cfg.sh -n dnode2 -c c
log -v 2
system sh/cfg.sh -n dnode3 -c c
log -v 2
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 1
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录