test: case from drop dnode which has mnode
This commit is contained in:
parent
01ee72afdc
commit
35c74839f6
|
@ -21,7 +21,7 @@
|
||||||
#include "mndShow.h"
|
#include "mndShow.h"
|
||||||
|
|
||||||
#ifndef _GRANT
|
#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) {
|
int32_t mndInitGrant(SMnode *pMnode) {
|
||||||
mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_GRANTS, mndRetrieveGrant);
|
mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_GRANTS, mndRetrieveGrant);
|
||||||
|
|
|
@ -240,7 +240,7 @@ static int32_t sdbReadFileImp(SSdb *pSdb) {
|
||||||
if (pFile == NULL) {
|
if (pFile == NULL) {
|
||||||
taosMemoryFree(pRaw);
|
taosMemoryFree(pRaw);
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
# ---- dnode
|
# ---- dnode
|
||||||
./test.sh -f tsim/dnode/create_dnode.sim
|
./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
|
# ---- insert
|
||||||
./test.sh -f tsim/insert/basic0.sim
|
./test.sh -f tsim/insert/basic0.sim
|
||||||
|
|
|
@ -182,16 +182,5 @@ if $rows != 15 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
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 dnode1 -s stop -x SIGINT
|
||||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
|
|
|
@ -0,0 +1,98 @@
|
||||||
|
system sh/stop_dnodes.sh
|
||||||
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
|
system sh/deploy.sh -n dnode2 -i 2
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
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 online!
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
sql show dnodes
|
||||||
|
print ===> $data00 $data01 $data02 $data03 $data04 $data05
|
||||||
|
print ===> $data10 $data11 $data12 $data13 $data14 $data15
|
||||||
|
if $rows != 3 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
if $data(1)[4] != ready then
|
||||||
|
goto step1
|
||||||
|
endi
|
||||||
|
if $data(2)[4] != ready then
|
||||||
|
goto step1
|
||||||
|
endi
|
||||||
|
if $data(3)[4] != offline then
|
||||||
|
goto step1
|
||||||
|
endi
|
||||||
|
|
||||||
|
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 =============== 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 =============== 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
|
||||||
|
|
||||||
|
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
|
|
@ -1,52 +0,0 @@
|
||||||
system sh/stop_dnodes.sh
|
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
|
||||||
system sh/deploy.sh -n dnode2 -i 2
|
|
||||||
system sh/exec.sh -n dnode1 -s start
|
|
||||||
system sh/exec.sh -n dnode2 -s start
|
|
||||||
sql connect
|
|
||||||
|
|
||||||
print =============== step1 create dnode2
|
|
||||||
sql create dnode $hostname port 7200
|
|
||||||
|
|
||||||
$x = 0
|
|
||||||
step1:
|
|
||||||
$ = $x + 1
|
|
||||||
sleep 1000
|
|
||||||
if $x == 10 then
|
|
||||||
print ====> dnode not ready!
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
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
|
|
||||||
|
|
||||||
sql create dnode $hostname port 7300
|
|
||||||
sql drop dnode 3
|
|
||||||
sql_error drop dnode 1
|
|
||||||
|
|
||||||
print =============== step2: create mnode
|
|
||||||
sql create mnode on dnode 2
|
|
||||||
|
|
||||||
print =============== step3: drop dnode 3
|
|
||||||
sql drop dnode 2
|
|
||||||
sql show dnodes;
|
|
||||||
if $rows != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
if $data00 != 1 then
|
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
|
|
||||||
return
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
||||||
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
|
Loading…
Reference in New Issue