提交 f2f89db1 编写于 作者: H Hongze Cheng

Merge branch 'develop' into feature/2.0tsdb

......@@ -119,9 +119,14 @@ int32_t vnodeCreate(SMDCreateVnodeMsg *pVnodeCfg) {
}
int32_t vnodeDrop(int32_t vgId) {
if (tsDnodeVnodesHash == NULL) {
vTrace("vgId:%d, failed to drop, vgId not exist", vgId);
return TSDB_CODE_INVALID_VGROUP_ID;
}
SVnodeObj **ppVnode = (SVnodeObj **)taosHashGet(tsDnodeVnodesHash, (const char *)&vgId, sizeof(int32_t));
if (ppVnode == NULL || *ppVnode == NULL) {
vTrace("vgId:%d, failed to drop, vgId not exist", vgId);
vTrace("vgId:%d, failed to drop, vgId not find", vgId);
return TSDB_CODE_INVALID_VGROUP_ID;
}
......@@ -347,6 +352,7 @@ static void vnodeBuildVloadMsg(SVnodeObj *pVnode, SDMStatusMsg *pStatus) {
pLoad->status = pVnode->status;
pLoad->role = pVnode->role;
pLoad->replica = pVnode->syncCfg.replica;
pStatus->openVnodes++;
}
void vnodeBuildStatusMsg(void *param) {
......@@ -359,7 +365,6 @@ void vnodeBuildStatusMsg(void *param) {
if (*pVnode == NULL) continue;
vnodeBuildVloadMsg(*pVnode, pStatus);
pStatus++;
}
taosHashDestroyIter(pIter);
......@@ -412,6 +417,7 @@ static int vnodeGetWalInfo(void *ahandle, char *name, uint32_t *index) {
static void vnodeNotifyRole(void *ahandle, int8_t role) {
SVnodeObj *pVnode = ahandle;
vPrint("vgId:%d, sync role changed from %d to %d", pVnode->vgId, pVnode->role, role);
pVnode->role = role;
if (pVnode->role == TAOS_SYNC_ROLE_MASTER)
......
......@@ -15,7 +15,7 @@ cd ../../../debug; make
./test.sh -f general/cache/restart_metrics.sim
./test.sh -f general/cache/restart_table.sim
./test.sh -f general/connection/connections.sim
./test.sh -f general/connection/connection.sim
./test.sh -f general/column/commit.sim
./test.sh -f general/column/metrics.sim
......@@ -267,12 +267,12 @@ cd ../../../debug; make
##./test.sh -u -f unique/dnode/balancex.sim
##./test.sh -u -f unique/dnode/offline1.sim
##./test.sh -u -f unique/dnode/offline2.sim
#./test.sh -u -f unique/dnode/remove1.sim
#./test.sh -u -f unique/dnode/remove2.sim
./test.sh -u -f unique/dnode/remove1.sim
#hongze ./test.sh -u -f unique/dnode/remove2.sim
#./test.sh -u -f unique/dnode/vnode_clean.sim
##./test.sh -u -f unique/http/admin.sim
##./test.sh -u -f unique/http/opentsdb.sim
./test.sh -u -f unique/http/admin.sim
./test.sh -u -f unique/http/opentsdb.sim
#./test.sh -u -f unique/import/replica2.sim
#./test.sh -u -f unique/import/replica3.sim
......@@ -293,8 +293,7 @@ cd ../../../debug; make
./test.sh -u -f unique/mnode/mgmt26.sim
./test.sh -u -f unique/mnode/mgmt33.sim
./test.sh -u -f unique/mnode/mgmt34.sim
#./test.sh -u -f unique/mnode/mgmtr2.sim
#./test.sh -u -f unique/mnode/secondIp.sim
./test.sh -u -f unique/mnode/mgmtr2.sim
##./test.sh -u -f unique/table/delete_part.sim
......
......@@ -17,8 +17,8 @@ system sh/cfg.sh -n dnode4 -c wallevel -v 1
print ========== step1
system sh/exec_up.sh -n dnode1 -s start
sql connect
sleep 3000
sql connect
sql create database d1 maxTables 4
sql create table d1.t1 (t timestamp, i int)
......@@ -59,17 +59,17 @@ $x = 0
show2:
$x = $x + 1
sleep 2000
if $x == 30 then
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
if $data2_1 != 3 then
if $data2_1 != 1 then
goto show2
endi
if $data2_2 != 1 then
if $data2_2 != 3 then
goto show2
endi
......@@ -81,7 +81,7 @@ $x = 0
show3:
$x = $x + 1
sleep 2000
if $x == 30 then
if $x == 10 then
return -1
endi
......@@ -97,7 +97,7 @@ $x = 0
show4:
$x = $x + 1
sleep 2000
if $x == 30 then
if $x == 10 then
return -1
endi
......@@ -105,7 +105,7 @@ sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
if $data2_2 != NULL then
if $data2_2 != null then
goto show4
endi
......@@ -118,8 +118,8 @@ system sh/exec_up.sh -n dnode4 -s start
$x = 0
show5:
$x = $x + 1
sleep 3000
if $x == 20 then
sleep 2000
if $x == 10 then
return -1
endi
sql show dnodes
......@@ -127,10 +127,10 @@ print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
print dnode4 openVnodes $data2_4
if $data2_1 != 4 then
if $data2_1 != 0 then
goto show5
endi
if $data2_2 != NULL then
if $data2_2 != null then
goto show5
endi
if $data2_3 != 2 then
......
......@@ -10,15 +10,15 @@ 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 wallevel -v 1
system sh/cfg.sh -n dnode2 -c wallevel -v 1
system sh/cfg.sh -n dnode3 -c wallevel -v 1
system sh/cfg.sh -n dnode4 -c wallevel -v 1
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode4 -c wallevel -v 2
print ========== step1
system sh/exec_up.sh -n dnode1 -s start
sql connect
sleep 3000
sql connect
sql create database d1 maxTables 4
sql create table d1.t1 (t timestamp, i int)
......@@ -59,46 +59,51 @@ $x = 0
show2:
$x = $x + 1
sleep 2000
if $x == 30 then
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
if $data2_1 != 3 then
if $data2_1 != 1 then
goto show2
endi
if $data2_2 != 1 then
if $data2_2 != 3 then
goto show2
endi
print ========== step3
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
sql drop dnode $hostname2
sleep 7001
sleep 4000
$x = 0
show3:
$x = $x + 1
sleep 2000
if $x == 30 then
return -1
endi
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2 $data5_192.168.0.2
print dnode2 openVnodes $data2_2
print ========== step4
sql create dnode $hostname3
system sh/exec_up.sh -n dnode3 -s start
sleep 5000
sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
if $data2_3 != 0 then
return -1
endi
print ============ step 4.1
system sh/exec_up.sh -n dnode2 -s start
$x = 0
show4:
$x = $x + 1
sleep 2000
if $x == 30 then
if $x == 10 then
return -1
endi
......@@ -106,13 +111,13 @@ sql show dnodes
print dnode1 openVnodes $data2_1
print dnode2 openVnodes $data2_2
print dnode3 openVnodes $data2_3
if $data2_2 != NULL then
if $data2_2 != null then
goto show4
endi
if $data2_1 != 3 then
if $data2_1 != 1 then
goto show4
endi
if $data2_3 != 1 then
if $data2_3 != 3 then
goto show4
endi
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c http -v 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135
system sh/exec_up.sh -n dnode1 -s start
sleep 3000
......@@ -12,7 +14,7 @@ print ============================ dnode1 start
print =============== step1 - parse
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/
print $system_content
if $system_content != @{"status":"error","code":1057,"desc":"database name can not be NULL"}@ then
if $system_content != @{"status":"error","code":1057,"desc":"database name can not be null"}@ then
return -1
endi
......@@ -24,7 +26,7 @@ endi
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/
print $system_content
if $system_content != @{"status":"error","code":1057,"desc":"database name can not be NULL"}@ then
if $system_content != @{"status":"error","code":1057,"desc":"database name can not be null"}@ then
return -1
endi
......@@ -73,7 +75,7 @@ endi
system_content curl -u root:taosdata -d '[{"metric": "ab1234567890123456789012345678ab1234567890123456789012345678","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1065,"desc":"metric name length can not more than 22"}@ then
if $system_content != @{"errors":[{"datapoint":{"metric":"ab1234567890123456789012345678ab1234567890123456789012345678","stable":"ab1234567890123456789012345678ab1234567890123456789012345678_d_bbb","table":"ab1234567890123456789012345678ab1234567890123456789012345678_d_bbb_lga_1_web01","timestamp":1346846400,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"status":"error","code":-2147483389}}],"failed":1,"success":0,"affected_rows":0}@ then
return -1
endi
......@@ -123,13 +125,13 @@ endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": "web01","group1": "1","group1": "1","group1": "1","group1": "1","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1071,"desc":"tags size too long"}@ then
if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbbbbbb","table":"sys_cpu_d_bbbbbbb_lga_1_1_1_1_1_web01","timestamp":1346846400,"value":18.000000,"tags":{"dc":"lga","group1":"1","group1":"1","group1":"1","group1":"1","group1":"1","host":"web01"},"status":"error","code":-2147483445}}],"failed":1,"success":0,"affected_rows":0}@ then
return -1
endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"": "web01"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1073,"desc":"tag name is NULL"}@ then
if $system_content != @{"status":"error","code":1073,"desc":"tag name is null"}@ then
return -1
endi
......@@ -147,7 +149,7 @@ endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400,"value": 18,"tags": {"host": ""}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"status":"error","code":1076,"desc":"tag value is NULL"}@ then
if $system_content != @{"status":"error","code":1076,"desc":"tag value is null"}@ then
return -1
endi
......@@ -162,7 +164,7 @@ endi
system_content curl -u root:taosdata -d '[{"metric": "sys_cpu","timestamp": 1346846400000,"value": 18,"tags": {"host": "web01","group1": "1","dc": "lga"}}]' 127.0.0.1:6020/opentsdb/db/put
print $system_content
if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web01","timestamp":1346846400000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"affected_rows":0,"status":"succ"}}],"failed":0,"success":1,"affected_rows":0}@ then
if $system_content != @{"errors":[{"datapoint":{"metric":"sys_cpu","stable":"sys_cpu_d_bbb","table":"sys_cpu_d_bbb_lga_1_web01","timestamp":1346846400000,"value":18.000000,"tags":{"dc":"lga","group1":"1","host":"web01"},"affected_rows":1,"status":"succ"}}],"failed":0,"success":1,"affected_rows":1}@ then
return -1
endi
......@@ -202,7 +204,7 @@ system_content curl -u root:taosdata -d '[{"metric": "sys_mem","timestamp": 134
print $system_content
if $system_content != @{"failed":0,"success":2}@ then
if $system_content != @{"failed":1,"success":1}@ then
return -1
endi
......
......@@ -9,8 +9,8 @@ system sh/cfg.sh -n dnode3 -c numOfMPeers -v 2
print ============== step1
system sh/exec_up.sh -n dnode1 -s start
sql connect
sleep 3000
sql connect
sql show mnodes
$dnode1Role = $data2_1
......@@ -23,16 +23,15 @@ print dnode3 ==> $dnode3Role
if $dnode1Role != master then
return -1
endi
if $dnode2Role != NULL then
if $dnode2Role != null then
return -1
endi
if $dnode3Role != NULL then
if $dnode3Role != null then
return -1
endi
print ============== step2
sql create dnode $hostname2
sleep 1700
sql create dnode $hostname3
print ============== step3
......@@ -68,10 +67,10 @@ print dnode3 ==> $dnode3Role
if $dnode1Role != master then
return -1
endi
if $rows != 2 then
if $dnode2Role != slave then
return -1
endi
if $dnode3Role != NULL then
if $dnode3Role != null then
return -1
endi
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
print ========== step1 dnode2 start
system sh/exec_up.sh -n dnode2 -s start
sql connect
print ========== step2 connect to dnode2
sql create dnode $hostname1
system sh/exec_up.sh -n dnode1 -s start
sleep 3000
print ========== step3
sql show dnodes
print dnode1 openvnodes $data3_1
print dnode2 openvnodes $data3_2
print dnode1 totalvnodes $data4_1
print dnode2 totalvnodes $data4_2
if $rows != 2 then
return -1
endi
if $data3_1 != 0 then
return -1
endi
if $data3_2 != 0 then
return -1
endi
if $data4_1 != 4 then
return -1
endi
if $data4_2 != 4 then
return -1
endi
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
\ No newline at end of file
......@@ -5,5 +5,4 @@ run unique/mnode/mgmt25.sim
run unique/mnode/mgmt26.sim
run unique/mnode/mgmt33.sim
run unique/mnode/mgmt34.sim
#run unique/mnode/mgmtr2.sim
#run unique/mnode/secondIp.sim
run unique/mnode/mgmtr2.sim
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册