From eeff1ada1076528ebdc7fb01534ee679c0ea1447 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 19 Sep 2024 19:29:16 +0800 Subject: [PATCH 1/3] fix invalid retry --- source/dnode/mgmt/node_mgmt/src/dmTransport.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index 986bbc4ac8..abebf576fe 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -24,6 +24,14 @@ static inline void dmBuildMnodeRedirectRsp(SDnode *pDnode, SRpcMsg *pMsg) { SEpSet epSet = {0}; dmGetMnodeEpSetForRedirect(&pDnode->data, pMsg, &epSet); + if (epSet.numOfEps == 0) { + pMsg->code = TSDB_CODE_MNODE_NOT_FOUND; + return; + } else if (epSet.numOfEps == 1) { + pMsg->code = TSDB_CODE_MNODE_NOT_FOUND; + return; + } + int32_t contLen = tSerializeSEpSet(NULL, 0, &epSet); pMsg->pCont = rpcMallocCont(contLen); if (pMsg->pCont == NULL) { @@ -109,7 +117,8 @@ static void dmProcessRpcMsg(SDnode *pDnode, SRpcMsg *pRpc, SEpSet *pEpSet) { int32_t svrVer = 0; (void)taosVersionStrToInt(version, &svrVer); if ((code = taosCheckVersionCompatible(pRpc->info.cliVer, svrVer, 3)) != 0) { - dError("Version not compatible, cli ver: %d, svr ver: %d, ip:0x%x", pRpc->info.cliVer, svrVer, pRpc->info.conn.clientIp); + dError("Version not compatible, cli ver: %d, svr ver: %d, ip:0x%x", pRpc->info.cliVer, svrVer, + pRpc->info.conn.clientIp); goto _OVER; } @@ -437,7 +446,7 @@ int32_t dmInitStatusClient(SDnode *pDnode) { pTrans->statusRpc = rpcOpen(&rpcInit); if (pTrans->statusRpc == NULL) { - dError("failed to init dnode rpc status client since %s", tstrerror(terrno)); + dError("failed to init dnode rpc status client since %s", tstrerror(terrno)); return terrno; } From a32c0f47cee069ddf0c880f34b138d77533f75f2 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 19 Sep 2024 19:30:17 +0800 Subject: [PATCH 2/3] fix invalid retr3 From 20b505a4829a475a6ecf64ec8862b26a8938cb22 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 19 Sep 2024 19:30:26 +0800 Subject: [PATCH 3/3] fix invalid retr3 --- source/dnode/mgmt/node_mgmt/src/dmTransport.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index abebf576fe..e204b5d4aa 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -24,10 +24,8 @@ static inline void dmBuildMnodeRedirectRsp(SDnode *pDnode, SRpcMsg *pMsg) { SEpSet epSet = {0}; dmGetMnodeEpSetForRedirect(&pDnode->data, pMsg, &epSet); - if (epSet.numOfEps == 0) { - pMsg->code = TSDB_CODE_MNODE_NOT_FOUND; - return; - } else if (epSet.numOfEps == 1) { + if (epSet.numOfEps <= 1) { + pMsg->pCont = NULL; pMsg->code = TSDB_CODE_MNODE_NOT_FOUND; return; }