diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 5acb3237573e803e49d60db14399a94fc3e64533..d8621f526b65a32835f8e0345e955eac1cb9eb41 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -336,7 +336,6 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) { if (rpcMsg->code != TSDB_CODE_ACTION_IN_PROGRESS) { rpcMsg->code = (pRes->code == TSDB_CODE_SUCCESS) ? pRes->numOfRows: pRes->code; - tscTrace("%p SQL result:%s res:%p", pSql, tstrerror(pRes->code), pSql); bool shouldFree = tscShouldBeFreed(pSql); (*pSql->fp)(pSql->param, pSql, rpcMsg->code); diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 57db775a5093604c56bce3d972910fe055f464fa..1b9fec7211540062f56dc29b1fcf1fdf795b89f4 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -404,8 +404,6 @@ void tscPartiallyFreeSqlObj(SSqlObj* pSql) { pSql->numOfSubs = 0; tscResetSqlCmdObj(pCmd); - - tscTrace("%p partially free sqlObj completed", pSql); } void tscFreeSqlObj(SSqlObj* pSql) { diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index 56592aff4b61af17bd8a6261724da619c5fe3f7b..bb4ea49f23e427e05caa333de4cc687b94ffc466 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -1284,7 +1284,7 @@ static int32_t mnodeProcessSuperTableVgroupMsg(SMnodeMsg *pMsg) { char *msg = (char *)pRsp + sizeof(SCMSTableVgroupRspMsg); for (int32_t i = 0; i < numOfTable; ++i) { - char *stableName = (char*)pInfo + sizeof(SCMSTableVgroupMsg) + (TSDB_TABLE_ID_LEN) * i; + char * stableName = (char *)pInfo + sizeof(SCMSTableVgroupMsg) + (TSDB_TABLE_ID_LEN)*i; SSuperTableObj *pTable = mnodeGetSuperTable(stableName); if (pTable == NULL) { mError("stable:%s, not exist while get stable vgroup info", stableName); @@ -1294,41 +1294,48 @@ static int32_t mnodeProcessSuperTableVgroupMsg(SMnodeMsg *pMsg) { if (pTable->vgHash == NULL) { mError("stable:%s, not vgroup exist while get stable vgroup info", stableName); mnodeDecTableRef(pTable); - continue; - } - SVgroupsInfo *pVgroupInfo = (SVgroupsInfo *)msg; + // even this super table has no corresponding table, still return + pRsp->numOfTables++; - SHashMutableIterator *pIter = taosHashCreateIter(pTable->vgHash); - int32_t vgSize = 0; - while (taosHashIterNext(pIter)) { - int32_t *pVgId = taosHashIterGet(pIter); - SVgObj * pVgroup = mnodeGetVgroup(*pVgId); - if (pVgroup == NULL) continue; + SVgroupsInfo *pVgroupInfo = (SVgroupsInfo *)msg; + pVgroupInfo->numOfVgroups = 0; + + msg += sizeof(SVgroupsInfo); + } else { + SVgroupsInfo *pVgroupInfo = (SVgroupsInfo *)msg; - pVgroupInfo->vgroups[vgSize].vgId = htonl(pVgroup->vgId); - for (int32_t vn = 0; vn < pVgroup->numOfVnodes; ++vn) { - SDnodeObj *pDnode = pVgroup->vnodeGid[vn].pDnode; - if (pDnode == NULL) break; + SHashMutableIterator *pIter = taosHashCreateIter(pTable->vgHash); + int32_t vgSize = 0; + while (taosHashIterNext(pIter)) { + int32_t *pVgId = taosHashIterGet(pIter); + SVgObj * pVgroup = mnodeGetVgroup(*pVgId); + if (pVgroup == NULL) continue; - strncpy(pVgroupInfo->vgroups[vgSize].ipAddr[vn].fqdn, pDnode->dnodeFqdn, tListLen(pDnode->dnodeFqdn)); - pVgroupInfo->vgroups[vgSize].ipAddr[vn].port = htons(pDnode->dnodePort); + pVgroupInfo->vgroups[vgSize].vgId = htonl(pVgroup->vgId); + for (int32_t vn = 0; vn < pVgroup->numOfVnodes; ++vn) { + SDnodeObj *pDnode = pVgroup->vnodeGid[vn].pDnode; + if (pDnode == NULL) break; - pVgroupInfo->vgroups[vgSize].numOfIps++; - } + strncpy(pVgroupInfo->vgroups[vgSize].ipAddr[vn].fqdn, pDnode->dnodeFqdn, tListLen(pDnode->dnodeFqdn)); + pVgroupInfo->vgroups[vgSize].ipAddr[vn].port = htons(pDnode->dnodePort); - vgSize++; - mnodeDecVgroupRef(pVgroup); - } + pVgroupInfo->vgroups[vgSize].numOfIps++; + } - taosHashDestroyIter(pIter); - mnodeDecTableRef(pTable); + vgSize++; + mnodeDecVgroupRef(pVgroup); + } + + taosHashDestroyIter(pIter); + mnodeDecTableRef(pTable); - pVgroupInfo->numOfVgroups = htonl(vgSize); + pVgroupInfo->numOfVgroups = htonl(vgSize); - // one table is done, try the next table - msg += sizeof(SVgroupsInfo) + vgSize * sizeof(SCMVgroupInfo); - pRsp->numOfTables++; + // one table is done, try the next table + msg += sizeof(SVgroupsInfo) + vgSize * sizeof(SCMVgroupInfo); + pRsp->numOfTables++; + } } if (pRsp->numOfTables != numOfTable) {