提交 35c74839 编写于 作者: S Shengliang Guan

test: case from drop dnode which has mnode

上级 01ee72af
......@@ -21,7 +21,7 @@
#include "mndShow.h"
#ifndef _GRANT
static int32_t mndRetrieveGrant(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows) { return TSDB_CODE_OPS_NOT_SUPPORT; }
static int32_t mndRetrieveGrant(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock* pBlock, int32_t rows) { return 0; }
int32_t mndInitGrant(SMnode *pMnode) {
mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_GRANTS, mndRetrieveGrant);
......
......@@ -240,7 +240,7 @@ static int32_t sdbReadFileImp(SSdb *pSdb) {
if (pFile == NULL) {
taosMemoryFree(pRaw);
terrno = TAOS_SYSTEM_ERROR(errno);
mError("failed to read sdb file:%s since %s", file, terrstr());
mDebug("failed to read sdb file:%s since %s", file, terrstr());
return 0;
}
......
......@@ -22,7 +22,7 @@
# ---- dnode
./test.sh -f tsim/dnode/create_dnode.sim
./test.sh -f tsim/dnode/drop_dnode_mnode.sim
./test.sh -f tsim/dnode/drop_dnode_has_mnode.sim
# ---- insert
./test.sh -f tsim/insert/basic0.sim
......
......@@ -182,16 +182,5 @@ if $rows != 15 then
return -1
endi
print =============== drop dnode
#sql drop dnode 2;
#sql show dnodes;
#if $rows != 1 then
# return -1
#endi
#if $data00 != 1 then
# return -1
#endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
......@@ -7,19 +7,20 @@ sql connect
print =============== step1 create dnode2
sql create dnode $hostname port 7200
sql create dnode $hostname port 7300
$x = 0
step1:
$ = $x + 1
sleep 1000
if $x == 10 then
print ====> dnode not ready!
print ====> dnode not online!
return -1
endi
sql show dnodes
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
if $rows != 2 then
if $rows != 3 then
return -1
endi
if $data(1)[4] != ready then
......@@ -28,25 +29,70 @@ endi
if $data(2)[4] != ready then
goto step1
endi
if $data(3)[4] != offline then
goto step1
endi
sql create dnode $hostname port 7300
sql drop dnode 3
print =============== step2 drop dnode 3
sql_error drop dnode 1
sql drop dnode 3
sql show dnodes
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
if $rows != 2 then
return -1
endi
if $data(1)[4] != ready then
goto step1
endi
if $data(2)[4] != ready then
goto step1
endi
print =============== step2: create mnode
print =============== step3: create mnode on dnode 2
sql create mnode on dnode 2
$x = 0
step3:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step3
print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4]
if $data(1)[2] != leader then
goto step3
endi
if $data(2)[2] != follower then
goto step3
endi
print =============== step3: drop dnode 3
print =============== step4: drop dnode 2
sql drop dnode 2
print show dnodes;
sql show dnodes;
print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4]
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
return
print show dnodes;
sql show mnodes
print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4]
if $rows != 1 then
return -1
endi
if $data(1)[2] != leader then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册