Merge pull request #14149 from taosdata/fix/dnode
feat: let drop dnode support ep
This commit is contained in:
commit
6241799b29
|
@ -648,30 +648,30 @@ _OVER:
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t mndProcessDropDnodeReq(SRpcMsg *pReq) {
|
static int32_t mndProcessDropDnodeReq(SRpcMsg *pReq) {
|
||||||
SMnode *pMnode = pReq->info.node;
|
SMnode *pMnode = pReq->info.node;
|
||||||
int32_t code = -1;
|
int32_t code = -1;
|
||||||
SDnodeObj *pDnode = NULL;
|
SDnodeObj *pDnode = NULL;
|
||||||
SMnodeObj *pMObj = NULL;
|
SMnodeObj *pMObj = NULL;
|
||||||
SQnodeObj *pQObj = NULL;
|
SQnodeObj *pQObj = NULL;
|
||||||
SSnodeObj *pSObj = NULL;
|
SSnodeObj *pSObj = NULL;
|
||||||
SMDropMnodeReq dropReq = {0};
|
SDropDnodeReq dropReq = {0};
|
||||||
|
|
||||||
if (tDeserializeSCreateDropMQSBNodeReq(pReq->pCont, pReq->contLen, &dropReq) != 0) {
|
if (tDeserializeSDropDnodeReq(pReq->pCont, pReq->contLen, &dropReq) != 0) {
|
||||||
terrno = TSDB_CODE_INVALID_MSG;
|
terrno = TSDB_CODE_INVALID_MSG;
|
||||||
goto _OVER;
|
goto _OVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
mInfo("dnode:%d, start to drop", dropReq.dnodeId);
|
mInfo("dnode:%d, start to drop, ep:%s:%d", dropReq.dnodeId, dropReq.fqdn, dropReq.port);
|
||||||
|
|
||||||
if (dropReq.dnodeId <= 0) {
|
|
||||||
terrno = TSDB_CODE_MND_INVALID_DNODE_ID;
|
|
||||||
goto _OVER;
|
|
||||||
}
|
|
||||||
|
|
||||||
pDnode = mndAcquireDnode(pMnode, dropReq.dnodeId);
|
pDnode = mndAcquireDnode(pMnode, dropReq.dnodeId);
|
||||||
if (pDnode == NULL) {
|
if (pDnode == NULL) {
|
||||||
terrno = TSDB_CODE_MND_DNODE_NOT_EXIST;
|
char ep[TSDB_EP_LEN + 1] = {0};
|
||||||
goto _OVER;
|
snprintf(ep, sizeof(ep), dropReq.fqdn, dropReq.port);
|
||||||
|
pDnode = mndAcquireDnodeByEp(pMnode, ep);
|
||||||
|
if (pDnode == NULL) {
|
||||||
|
terrno = TSDB_CODE_MND_DNODE_NOT_EXIST;
|
||||||
|
goto _OVER;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pQObj = mndAcquireQnode(pMnode, dropReq.dnodeId);
|
pQObj = mndAcquireQnode(pMnode, dropReq.dnodeId);
|
||||||
|
@ -726,6 +726,7 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mInfo("dnode:%d, start to config, option:%s, value:%s", cfgReq.dnodeId, cfgReq.config, cfgReq.value);
|
||||||
SDnodeObj *pDnode = mndAcquireDnode(pMnode, cfgReq.dnodeId);
|
SDnodeObj *pDnode = mndAcquireDnode(pMnode, cfgReq.dnodeId);
|
||||||
if (pDnode == NULL) {
|
if (pDnode == NULL) {
|
||||||
mError("dnode:%d, failed to config since %s ", cfgReq.dnodeId, terrstr());
|
mError("dnode:%d, failed to config since %s ", cfgReq.dnodeId, terrstr());
|
||||||
|
@ -742,7 +743,7 @@ static int32_t mndProcessConfigDnodeReq(SRpcMsg *pReq) {
|
||||||
tSerializeSMCfgDnodeReq(pBuf, bufLen, &cfgReq);
|
tSerializeSMCfgDnodeReq(pBuf, bufLen, &cfgReq);
|
||||||
|
|
||||||
mDebug("dnode:%d, send config req to dnode, app:%p", cfgReq.dnodeId, pReq->info.ahandle);
|
mDebug("dnode:%d, send config req to dnode, app:%p", cfgReq.dnodeId, pReq->info.ahandle);
|
||||||
SRpcMsg rpcMsg = {.msgType = TDMT_DND_CONFIG_DNODE, .pCont = pBuf, .contLen = bufLen, .info = pReq->info};
|
SRpcMsg rpcMsg = {.msgType = TDMT_DND_CONFIG_DNODE, .pCont = pBuf, .contLen = bufLen};
|
||||||
return tmsgSendReq(&epSet, &rpcMsg);
|
return tmsgSendReq(&epSet, &rpcMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -233,6 +233,7 @@ if $data(1)[3] != dropping then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step9: start mnode1 and wait it dropped
|
print =============== step9: start mnode1 and wait it dropped
|
||||||
|
sleep 3000
|
||||||
system sh/exec.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
|
|
|
@ -233,12 +233,12 @@ if $rows != 4 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show dnode 1 variables;
|
sql show dnode 1 variables;
|
||||||
if $rows != 116 then
|
if $rows <= 0 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
sql show local variables;
|
sql show local variables;
|
||||||
if $rows != 50 then
|
if $rows <= 0 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue