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,9 +30,18 @@ static inline void dmBuildMnodeRedirectRsp(SDnode *pDnode, SRpcMsg *pMsg) {
|
||||||
dmGetMnodeEpSetForRedirect(&pDnode->data, pMsg, &epSet);
|
dmGetMnodeEpSetForRedirect(&pDnode->data, pMsg, &epSet);
|
||||||
|
|
||||||
if (epSet.numOfEps <= 1) {
|
if (epSet.numOfEps <= 1) {
|
||||||
pMsg->pCont = NULL;
|
if (epSet.numOfEps == 0) {
|
||||||
pMsg->code = TSDB_CODE_MNODE_NOT_FOUND;
|
pMsg->pCont = NULL;
|
||||||
return;
|
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);
|
int32_t contLen = tSerializeSEpSet(NULL, 0, &epSet);
|
||||||
|
|
Loading…
Reference in New Issue