Merge pull request #21498 from taosdata/fix/check-empty-dnode
check empty dnode
This commit is contained in:
commit
3b6d196ec3
|
@ -986,20 +986,20 @@ static int32_t mndProcessDropDnodeReq(SRpcMsg *pReq) {
|
|||
}
|
||||
|
||||
int32_t numOfVnodes = mndGetVnodesNum(pMnode, pDnode->id);
|
||||
if (numOfVnodes > 0 || pMObj != NULL || pSObj != NULL || pQObj != NULL) {
|
||||
bool isonline = mndIsDnodeOnline(pDnode, taosGetTimestampMs());
|
||||
if (isonline && force) {
|
||||
terrno = TSDB_CODE_DNODE_ONLY_USE_WHEN_OFFLINE;
|
||||
mError("dnode:%d, failed to drop since %s, vnodes:%d mnode:%d qnode:%d snode:%d", pDnode->id, terrstr(),
|
||||
numOfVnodes, pMObj != NULL, pQObj != NULL, pSObj != NULL);
|
||||
goto _OVER;
|
||||
}
|
||||
if (!isonline && !force) {
|
||||
terrno = TSDB_CODE_DNODE_OFFLINE;
|
||||
mError("dnode:%d, failed to drop since %s, vnodes:%d mnode:%d qnode:%d snode:%d", pDnode->id, terrstr(),
|
||||
numOfVnodes, pMObj != NULL, pQObj != NULL, pSObj != NULL);
|
||||
goto _OVER;
|
||||
}
|
||||
bool isonline = mndIsDnodeOnline(pDnode, taosGetTimestampMs());
|
||||
|
||||
if (isonline && force) {
|
||||
terrno = TSDB_CODE_DNODE_ONLY_USE_WHEN_OFFLINE;
|
||||
mError("dnode:%d, failed to drop since %s, vnodes:%d mnode:%d qnode:%d snode:%d", pDnode->id, terrstr(),
|
||||
numOfVnodes, pMObj != NULL, pQObj != NULL, pSObj != NULL);
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
if (!isonline && !force) {
|
||||
terrno = TSDB_CODE_DNODE_OFFLINE;
|
||||
mError("dnode:%d, failed to drop since %s, vnodes:%d mnode:%d qnode:%d snode:%d", pDnode->id, terrstr(),
|
||||
numOfVnodes, pMObj != NULL, pQObj != NULL, pSObj != NULL);
|
||||
goto _OVER;
|
||||
}
|
||||
|
||||
code = mndDropDnode(pMnode, pReq, pDnode, pMObj, pQObj, pSObj, numOfVnodes, force, dropReq.unsafe);
|
||||
|
|
|
@ -35,7 +35,7 @@ endi
|
|||
|
||||
print =============== step2 drop dnode 3
|
||||
sql_error drop dnode 1
|
||||
sql drop dnode 3
|
||||
sql drop dnode 3 force
|
||||
|
||||
sql select * from information_schema.ins_dnodes
|
||||
print ===> $data00 $data01 $data02 $data03 $data04 $data05
|
||||
|
|
|
@ -57,7 +57,7 @@ if $data(2)[7] != @status msg timeout@ then
|
|||
endi
|
||||
|
||||
print ========== step4
|
||||
sql drop dnode 2
|
||||
sql drop dnode 2 force
|
||||
sql select * from information_schema.ins_dnodes
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
|
|
|
@ -20,7 +20,7 @@ sql_error alter user u2 sysinfo 0
|
|||
print =============== step2 create drop dnode
|
||||
sql create dnode $hostname port 7200
|
||||
sql create dnode $hostname port 7300
|
||||
sql drop dnode 3
|
||||
sql drop dnode 3 force
|
||||
sql alter dnode 1 'debugflag 131'
|
||||
|
||||
print =============== step3: select * from information_schema.ins_dnodes
|
||||
|
|
Loading…
Reference in New Issue