diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 75e4c9606fb7ac4ef531975d3c56c29b07fa5039..f377168c53c1d87bc0b67a4c41f9bb41a64f6a95 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -224,7 +224,7 @@ void tscGetConnToVnode(SSqlObj *pSql, uint8_t *pCode) { (pSql->index) = (pSql->index + 1) % TSDB_VNODES_SUPPORT; continue; } - *pCode = 0; + *pCode = TSDB_CODE_SUCCESS; void *thandle = taosGetConnFromCache(tscConnCache, pVPeersDesc[pSql->index].ip, pVPeersDesc[pSql->index].vnode, pTscObj->user); @@ -250,7 +250,7 @@ void tscGetConnToVnode(SSqlObj *pSql, uint8_t *pCode) { pSql->thandle = thandle; pSql->ip = pVPeersDesc[pSql->index].ip; pSql->vnode = pVPeersDesc[pSql->index].vnode; - tscTrace("%p vnode:%d ip:0x%x index:%d is picked up, pConn:%p", pSql, pVPeersDesc[pSql->index].vnode, + tscTrace("%p vnode:%d ip:%p index:%d is picked up, pConn:%p", pSql, pVPeersDesc[pSql->index].vnode, pVPeersDesc[pSql->index].ip, pSql->index, pSql->thandle); #else *pCode = 0; @@ -283,7 +283,11 @@ void tscGetConnToVnode(SSqlObj *pSql, uint8_t *pCode) { // the pSql->res.code is the previous error code. if (pSql->thandle == NULL && pSql->retry >= pSql->maxRetry) { - *pCode = pSql->res.code; + if (pSql->res.code != TSDB_CODE_SUCCESS) { + *pCode = pSql->res.code; + } + + tscError("%p reach the max retry:%d, code:%d", pSql, pSql->retry, *pCode); } } @@ -400,7 +404,6 @@ void *tscProcessMsgFromServer(char *msg, void *ahandle, void *thandle) { // for single node situation, do NOT try next index #endif pSql->thandle = NULL; - // todo taos_stop_query() in async model /* * in case of diff --git a/src/system/detail/src/mgmtDnodeInt.c b/src/system/detail/src/mgmtDnodeInt.c index 2b7fe3cf442e3e7aab2a10af0e974692fb886e77..e2150228691414e821401803ee230d9b06796873 100644 --- a/src/system/detail/src/mgmtDnodeInt.c +++ b/src/system/detail/src/mgmtDnodeInt.c @@ -103,7 +103,7 @@ int mgmtProcessVpeerCfgMsg(char *cont, int contLen, SDnodeObj *pObj) { mTrace("dnode:%s, vnode:%d, vgroup:%d, send create meter msg, code:%d", taosIpStr(pObj->privateIp), vnode, pVgroup->vgId, *pMsg); } else { mTrace("dnode:%s, vnode:%d, no vgroup info, vgroup:%d", taosIpStr(pObj->privateIp), vnode, pObj->vload[vnode].vgId); - *pMsg = TSDB_CODE_INVALID_VALUE; + *pMsg = TSDB_CODE_NOT_ACTIVE_VNODE; pMsg++; *(int32_t *)pMsg = htonl(vnode); pMsg += sizeof(int32_t);