Merge pull request #28437 from taosdata/fix/TD-32485
fix: the problem of taosc driver retrying errors after clearing the dnode data
This commit is contained in:
commit
91f8c4cfed
|
@ -30,10 +30,19 @@ static inline void dmBuildMnodeRedirectRsp(SDnode *pDnode, SRpcMsg *pMsg) {
|
|||
dmGetMnodeEpSetForRedirect(&pDnode->data, pMsg, &epSet);
|
||||
|
||||
if (epSet.numOfEps <= 1) {
|
||||
if (epSet.numOfEps == 0) {
|
||||
pMsg->pCont = NULL;
|
||||
pMsg->code = TSDB_CODE_MNODE_NOT_FOUND;
|
||||
return;
|
||||
}
|
||||
// dnode is not the mnode or mnode leader and This ensures that the function correctly handles cases where the
|
||||
// dnode cannot obtain a valid epSet and avoids returning an incorrect or misleading epSet.
|
||||
if (strcmp(epSet.eps[0].fqdn, tsLocalFqdn) == 0 && epSet.eps[0].port == tsServerPort) {
|
||||
pMsg->pCont = NULL;
|
||||
pMsg->code = TSDB_CODE_MNODE_NOT_FOUND;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
int32_t contLen = tSerializeSEpSet(NULL, 0, &epSet);
|
||||
pMsg->pCont = rpcMallocCont(contLen);
|
||||
|
|
Loading…
Reference in New Issue