Merge branch '3.0' into enh/TS-5111-3.0

This commit is contained in:
kailixu 2024-09-22 10:21:55 +08:00
commit d2d14db007
16 changed files with 186 additions and 175 deletions

View File

@ -37,7 +37,6 @@ void setQueryRequest(int64_t rId) {
pReq->isQuery = true; pReq->isQuery = true;
(void)releaseRequest(rId); (void)releaseRequest(rId);
} }
} }
static bool stringLengthCheck(const char* str, size_t maxsize) { static bool stringLengthCheck(const char* str, size_t maxsize) {
@ -2517,7 +2516,7 @@ TSDB_SERVER_STATUS taos_check_server_status(const char* fqdn, int port, char* de
void* clientRpc = NULL; void* clientRpc = NULL;
SServerStatusRsp statusRsp = {0}; SServerStatusRsp statusRsp = {0};
SEpSet epSet = {.inUse = 0, .numOfEps = 1}; SEpSet epSet = {.inUse = 0, .numOfEps = 1};
SRpcMsg rpcMsg = {.info.ahandle = (void*)0x9526, .msgType = TDMT_DND_SERVER_STATUS}; SRpcMsg rpcMsg = {.info.ahandle = (void*)0x9527, .info.notFreeAhandle = 1, .msgType = TDMT_DND_SERVER_STATUS};
SRpcMsg rpcRsp = {0}; SRpcMsg rpcRsp = {0};
SRpcInit rpcInit = {0}; SRpcInit rpcInit = {0};
char pass[TSDB_PASSWORD_LEN + 1] = {0}; char pass[TSDB_PASSWORD_LEN + 1] = {0};
@ -3032,7 +3031,8 @@ void taosAsyncFetchImpl(SRequestObj* pRequest, __taos_async_fn_t fp, void* param
void doRequestCallback(SRequestObj* pRequest, int32_t code) { void doRequestCallback(SRequestObj* pRequest, int32_t code) {
pRequest->inCallback = true; pRequest->inCallback = true;
int64_t this = pRequest->self; int64_t this = pRequest->self;
if (tsQueryTbNotExistAsEmpty && TD_RES_QUERY(&pRequest->resType) && pRequest->isQuery && (code == TSDB_CODE_PAR_TABLE_NOT_EXIST || code == TSDB_CODE_TDB_TABLE_NOT_EXIST)) { if (tsQueryTbNotExistAsEmpty && TD_RES_QUERY(&pRequest->resType) && pRequest->isQuery &&
(code == TSDB_CODE_PAR_TABLE_NOT_EXIST || code == TSDB_CODE_TDB_TABLE_NOT_EXIST)) {
code = TSDB_CODE_SUCCESS; code = TSDB_CODE_SUCCESS;
pRequest->type = TSDB_SQL_RETRIEVE_EMPTY_RESULT; pRequest->type = TSDB_SQL_RETRIEVE_EMPTY_RESULT;
} }

View File

@ -69,6 +69,7 @@ static void dmMayShouldUpdateIpWhiteList(SDnodeMgmt *pMgmt, int64_t ver) {
.contLen = contLen, .contLen = contLen,
.msgType = TDMT_MND_RETRIEVE_IP_WHITE, .msgType = TDMT_MND_RETRIEVE_IP_WHITE,
.info.ahandle = (void *)0x9527, .info.ahandle = (void *)0x9527,
.info.notFreeAhandle = 1,
.info.refId = 0, .info.refId = 0,
.info.noResp = 0, .info.noResp = 0,
.info.handle = 0}; .info.handle = 0};
@ -185,6 +186,7 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) {
.contLen = contLen, .contLen = contLen,
.msgType = TDMT_MND_STATUS, .msgType = TDMT_MND_STATUS,
.info.ahandle = (void *)0x9527, .info.ahandle = (void *)0x9527,
.info.notFreeAhandle = 1,
.info.refId = 0, .info.refId = 0,
.info.noResp = 0, .info.noResp = 0,
.info.handle = 0}; .info.handle = 0};
@ -234,6 +236,7 @@ void dmSendNotifyReq(SDnodeMgmt *pMgmt, SNotifyReq *pReq) {
.contLen = contLen, .contLen = contLen,
.msgType = TDMT_MND_NOTIFY, .msgType = TDMT_MND_NOTIFY,
.info.ahandle = (void *)0x9527, .info.ahandle = (void *)0x9527,
.info.notFreeAhandle = 1,
.info.refId = 0, .info.refId = 0,
.info.noResp = 1, .info.noResp = 1,
.info.handle = 0}; .info.handle = 0};

View File

@ -210,8 +210,11 @@ static void mndPullupGrant(SMnode *pMnode) {
int32_t contLen = 0; int32_t contLen = 0;
void *pReq = mndBuildTimerMsg(&contLen); void *pReq = mndBuildTimerMsg(&contLen);
if (pReq != NULL) { if (pReq != NULL) {
SRpcMsg rpcMsg = { SRpcMsg rpcMsg = {.msgType = TDMT_MND_GRANT_HB_TIMER,
.msgType = TDMT_MND_GRANT_HB_TIMER, .pCont = pReq, .contLen = contLen, .info.ahandle = (void *)0x9527}; .pCont = pReq,
.contLen = contLen,
.info.notFreeAhandle = 1,
.info.ahandle = (void *)0x9527};
// TODO check return value // TODO check return value
(void)tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); (void)tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg);
} }
@ -222,8 +225,11 @@ static void mndIncreaseUpTime(SMnode *pMnode) {
int32_t contLen = 0; int32_t contLen = 0;
void *pReq = mndBuildTimerMsg(&contLen); void *pReq = mndBuildTimerMsg(&contLen);
if (pReq != NULL) { if (pReq != NULL) {
SRpcMsg rpcMsg = { SRpcMsg rpcMsg = {.msgType = TDMT_MND_UPTIME_TIMER,
.msgType = TDMT_MND_UPTIME_TIMER, .pCont = pReq, .contLen = contLen, .info.ahandle = (void *)0x9528}; .pCont = pReq,
.contLen = contLen,
.info.notFreeAhandle = 1,
.info.ahandle = (void *)0x9527};
// TODO check return value // TODO check return value
(void)tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg); (void)tmsgPutToQueue(&pMnode->msgCb, WRITE_QUEUE, &rpcMsg);
} }

View File

@ -23,26 +23,26 @@ extern "C" {
#define SERIALIZE_MEM_TO_BUF(buf, key, mem) \ #define SERIALIZE_MEM_TO_BUF(buf, key, mem) \
do { \ do { \
(void)memcpy((void *)buf, (void *)(&key->mem), sizeof(key->mem)); \ TAOS_UNUSED(memcpy((void *)buf, (void *)(&key->mem), sizeof(key->mem))); \
buf += sizeof(key->mem); \ buf += sizeof(key->mem); \
} while (0) } while (0)
#define SERIALIZE_STR_MEM_TO_BUF(buf, key, mem, len) \ #define SERIALIZE_STR_MEM_TO_BUF(buf, key, mem, len) \
do { \ do { \
(void)memcpy((void *)buf, (void *)key->mem, len); \ TAOS_UNUSED(memcpy((void *)buf, (void *)key->mem, len)); \
buf += len; \ buf += len; \
} while (0) } while (0)
#define SERIALIZE_VAR_TO_BUF(buf, var, type) \ #define SERIALIZE_VAR_TO_BUF(buf, var, type) \
do { \ do { \
type c = var; \ type c = var; \
(void)memcpy((void *)buf, (void *)&c, sizeof(c)); \ TAOS_UNUSED(memcpy((void *)buf, (void *)&c, sizeof(c))); \
buf += sizeof(c); \ buf += sizeof(c); \
} while (0) } while (0)
#define SERIALIZE_STR_VAR_TO_BUF(buf, var, len) \ #define SERIALIZE_STR_VAR_TO_BUF(buf, var, len) \
do { \ do { \
(void)memcpy((void *)buf, (void *)var, len); \ TAOS_UNUSED(memcpy((void *)buf, (void *)var, len)); \
buf += len; \ buf += len; \
} while (0) } while (0)

View File

@ -99,15 +99,15 @@ static int32_t idxMergeCacheAndTFile(SArray* result, IterateValue* icache, Itera
static void idxPost(void* idx) { static void idxPost(void* idx) {
SIndex* pIdx = idx; SIndex* pIdx = idx;
(void)tsem_post(&pIdx->sem); TAOS_UNUSED(tsem_post(&pIdx->sem));
} }
static void indexWait(void* idx) { static void indexWait(void* idx) {
SIndex* pIdx = idx; SIndex* pIdx = idx;
(void)tsem_wait(&pIdx->sem); TAOS_UNUSED(tsem_wait(&pIdx->sem));
} }
int32_t indexOpen(SIndexOpts* opts, const char* path, SIndex** index) { int32_t indexOpen(SIndexOpts* opts, const char* path, SIndex** index) {
(void)taosThreadOnce(&isInit, indexEnvInit); TAOS_UNUSED(taosThreadOnce(&isInit, indexEnvInit));
int code = TSDB_CODE_SUCCESS; int code = TSDB_CODE_SUCCESS;
SIndex* idx = taosMemoryCalloc(1, sizeof(SIndex)); SIndex* idx = taosMemoryCalloc(1, sizeof(SIndex));
@ -137,8 +137,8 @@ int32_t indexOpen(SIndexOpts* opts, const char* path, SIndex** index) {
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, END); TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, END);
} }
(void)taosThreadMutexInit(&idx->mtx, NULL); TAOS_UNUSED(taosThreadMutexInit(&idx->mtx, NULL));
(void)tsem_init(&idx->sem, 0, 0); TAOS_UNUSED(tsem_init(&idx->sem, 0, 0));
idx->refId = idxAddRef(idx); idx->refId = idxAddRef(idx);
idx->opts = *opts; idx->opts = *opts;
@ -158,8 +158,8 @@ END:
void indexDestroy(void* handle) { void indexDestroy(void* handle) {
if (handle == NULL) return; if (handle == NULL) return;
SIndex* idx = handle; SIndex* idx = handle;
(void)taosThreadMutexDestroy(&idx->mtx); TAOS_UNUSED(taosThreadMutexDestroy(&idx->mtx));
(void)tsem_destroy(&idx->sem); TAOS_UNUSED(tsem_destroy(&idx->sem));
idxTFileDestroy(idx->tindex); idxTFileDestroy(idx->tindex);
taosMemoryFree(idx->path); taosMemoryFree(idx->path);
@ -190,7 +190,7 @@ void indexClose(SIndex* sIdx) {
} }
idxReleaseRef(sIdx->refId); idxReleaseRef(sIdx->refId);
(void)idxRemoveRef(sIdx->refId); TAOS_UNUSED(idxRemoveRef(sIdx->refId));
} }
int64_t idxAddRef(void* p) { int64_t idxAddRef(void* p) {
// impl // impl
@ -203,17 +203,17 @@ int32_t idxRemoveRef(int64_t ref) {
void idxAcquireRef(int64_t ref) { void idxAcquireRef(int64_t ref) {
// impl // impl
(void)taosAcquireRef(indexRefMgt, ref); TAOS_UNUSED(taosAcquireRef(indexRefMgt, ref));
} }
void idxReleaseRef(int64_t ref) { void idxReleaseRef(int64_t ref) {
// impl // impl
(void)taosReleaseRef(indexRefMgt, ref); TAOS_UNUSED(taosReleaseRef(indexRefMgt, ref));
} }
int32_t indexPut(SIndex* index, SIndexMultiTerm* fVals, uint64_t uid) { int32_t indexPut(SIndex* index, SIndexMultiTerm* fVals, uint64_t uid) {
// TODO(yihao): reduce the lock range // TODO(yihao): reduce the lock range
int32_t code = 0; int32_t code = 0;
(void)taosThreadMutexLock(&index->mtx); TAOS_UNUSED(taosThreadMutexLock(&index->mtx));
for (int i = 0; i < taosArrayGetSize(fVals); i++) { for (int i = 0; i < taosArrayGetSize(fVals); i++) {
SIndexTerm* p = taosArrayGetP(fVals, i); SIndexTerm* p = taosArrayGetP(fVals, i);
@ -231,7 +231,7 @@ int32_t indexPut(SIndex* index, SIndexMultiTerm* fVals, uint64_t uid) {
} }
} }
} }
(void)taosThreadMutexUnlock(&index->mtx); TAOS_UNUSED(taosThreadMutexUnlock(&index->mtx));
if (code != 0) { if (code != 0) {
return code; return code;
@ -278,7 +278,7 @@ int32_t indexSearch(SIndex* index, SIndexMultiTermQuery* multiQuerys, SArray* re
return TSDB_CODE_OUT_OF_MEMORY; return TSDB_CODE_OUT_OF_MEMORY;
} }
} }
(void)idxMergeFinalResults(iRslts, opera, result); TAOS_UNUSED(idxMergeFinalResults(iRslts, opera, result));
idxInterRsltDestroy(iRslts); idxInterRsltDestroy(iRslts);
return 0; return 0;
} }
@ -421,7 +421,7 @@ void indexRebuild(SIndexJson* idx, void* iter) {
schedMsg.fp = idxSchedRebuildIdx; schedMsg.fp = idxSchedRebuildIdx;
schedMsg.ahandle = idx; schedMsg.ahandle = idx;
idxAcquireRef(idx->refId); idxAcquireRef(idx->refId);
(void)taosScheduleTask(indexQhandle, &schedMsg); TAOS_UNUSED(taosScheduleTask(indexQhandle, &schedMsg));
} }
/* /*
@ -463,10 +463,10 @@ static int32_t idxTermSearch(SIndex* sIdx, SIndexTermQuery* query, SArray** resu
int32_t sz = idxSerialCacheKey(&key, buf); int32_t sz = idxSerialCacheKey(&key, buf);
(void)taosThreadMutexLock(&sIdx->mtx); TAOS_UNUSED(taosThreadMutexLock(&sIdx->mtx));
IndexCache** pCache = taosHashGet(sIdx->colObj, buf, sz); IndexCache** pCache = taosHashGet(sIdx->colObj, buf, sz);
cache = (pCache == NULL) ? NULL : *pCache; cache = (pCache == NULL) ? NULL : *pCache;
(void)taosThreadMutexUnlock(&sIdx->mtx); TAOS_UNUSED(taosThreadMutexUnlock(&sIdx->mtx));
*result = taosArrayInit(4, sizeof(uint64_t)); *result = taosArrayInit(4, sizeof(uint64_t));
if (*result == NULL) { if (*result == NULL) {
@ -757,9 +757,9 @@ static int64_t idxGetAvailableVer(SIndex* sIdx, IndexCache* cache) {
IndexTFile* tf = (IndexTFile*)(sIdx->tindex); IndexTFile* tf = (IndexTFile*)(sIdx->tindex);
(void)taosThreadMutexLock(&tf->mtx); TAOS_UNUSED(taosThreadMutexLock(&tf->mtx));
TFileReader* rd = tfileCacheGet(tf->cache, &key); TFileReader* rd = tfileCacheGet(tf->cache, &key);
(void)taosThreadMutexUnlock(&tf->mtx); TAOS_UNUSED(taosThreadMutexUnlock(&tf->mtx));
if (rd != NULL) { if (rd != NULL) {
ver = (ver > rd->header.version ? ver : rd->header.version) + 1; ver = (ver > rd->header.version ? ver : rd->header.version) + 1;
@ -801,9 +801,9 @@ static int32_t idxGenTFile(SIndex* sIdx, IndexCache* cache, SArray* batch) {
TFileHeader* header = &reader->header; TFileHeader* header = &reader->header;
ICacheKey key = {.suid = cache->suid, .colName = header->colName, .nColName = strlen(header->colName)}; ICacheKey key = {.suid = cache->suid, .colName = header->colName, .nColName = strlen(header->colName)};
(void)taosThreadMutexLock(&tf->mtx); TAOS_UNUSED(taosThreadMutexLock(&tf->mtx));
code = tfileCachePut(tf->cache, &key, reader); code = tfileCachePut(tf->cache, &key, reader);
(void)taosThreadMutexUnlock(&tf->mtx); TAOS_UNUSED(taosThreadMutexUnlock(&tf->mtx));
return code; return code;
@ -820,7 +820,7 @@ int32_t idxSerialCacheKey(ICacheKey* key, char* buf) {
char* p = buf; char* p = buf;
char tbuf[65] = {0}; char tbuf[65] = {0};
(void)idxInt2str((int64_t)key->suid, tbuf, 0); TAOS_UNUSED(idxInt2str((int64_t)key->suid, tbuf, 0));
SERIALIZE_STR_VAR_TO_BUF(buf, tbuf, strlen(tbuf)); SERIALIZE_STR_VAR_TO_BUF(buf, tbuf, strlen(tbuf));
SERIALIZE_VAR_TO_BUF(buf, '_', char); SERIALIZE_VAR_TO_BUF(buf, '_', char);

View File

@ -109,7 +109,7 @@ static int32_t cacheSearchTerm(void* cache, SIndexTerm* term, SIdxTRslt* tr, STe
} }
taosMemoryFree(pCt); taosMemoryFree(pCt);
(void)tSkipListDestroyIter(iter); TAOS_UNUSED(tSkipListDestroyIter(iter));
return code; return code;
} }
static int32_t cacheSearchPrefix(void* cache, SIndexTerm* term, SIdxTRslt* tr, STermValueType* s) { static int32_t cacheSearchPrefix(void* cache, SIndexTerm* term, SIdxTRslt* tr, STermValueType* s) {
@ -178,7 +178,7 @@ static int32_t cacheSearchCompareFunc(void* cache, SIndexTerm* term, SIdxTRslt*
_return: _return:
taosMemoryFree(pCt); taosMemoryFree(pCt);
(void)tSkipListDestroyIter(iter); TAOS_UNUSED(tSkipListDestroyIter(iter));
return code; return code;
} }
static int32_t cacheSearchLessThan(void* cache, SIndexTerm* term, SIdxTRslt* tr, STermValueType* s) { static int32_t cacheSearchLessThan(void* cache, SIndexTerm* term, SIdxTRslt* tr, STermValueType* s) {
@ -244,7 +244,7 @@ static int32_t cacheSearchTerm_JSON(void* cache, SIndexTerm* term, SIdxTRslt* tr
taosMemoryFree(pCt); taosMemoryFree(pCt);
taosMemoryFree(exBuf); taosMemoryFree(exBuf);
(void)tSkipListDestroyIter(iter); TAOS_UNUSED(tSkipListDestroyIter(iter));
return code; return code;
} }
static int32_t cacheSearchSuffix_JSON(void* cache, SIndexTerm* term, SIdxTRslt* tr, STermValueType* s) { static int32_t cacheSearchSuffix_JSON(void* cache, SIndexTerm* term, SIdxTRslt* tr, STermValueType* s) {
@ -363,7 +363,7 @@ static int32_t cacheSearchCompareFunc_JSON(void* cache, SIndexTerm* term, SIdxTR
_return: _return:
taosMemoryFree(pCt); taosMemoryFree(pCt);
taosMemoryFree(exBuf); taosMemoryFree(exBuf);
(void)tSkipListDestroyIter(iter); TAOS_UNUSED(tSkipListDestroyIter(iter));
return code; return code;
} }
@ -390,8 +390,8 @@ IndexCache* idxCacheCreate(SIndex* idx, uint64_t suid, const char* colName, int8
cache->suid = suid; cache->suid = suid;
cache->occupiedMem = 0; cache->occupiedMem = 0;
(void)taosThreadMutexInit(&cache->mtx, NULL); TAOS_UNUSED(taosThreadMutexInit(&cache->mtx, NULL));
(void)taosThreadCondInit(&cache->finished, NULL); TAOS_UNUSED(taosThreadCondInit(&cache->finished, NULL));
idxCacheRef(cache); idxCacheRef(cache);
if (idx != NULL) { if (idx != NULL) {
@ -402,10 +402,10 @@ IndexCache* idxCacheCreate(SIndex* idx, uint64_t suid, const char* colName, int8
void idxCacheDebug(IndexCache* cache) { void idxCacheDebug(IndexCache* cache) {
MemTable* tbl = NULL; MemTable* tbl = NULL;
(void)taosThreadMutexLock(&cache->mtx); TAOS_UNUSED(taosThreadMutexLock(&cache->mtx));
tbl = cache->mem; tbl = cache->mem;
idxMemRef(tbl); idxMemRef(tbl);
(void)taosThreadMutexUnlock(&cache->mtx); TAOS_UNUSED(taosThreadMutexUnlock(&cache->mtx));
{ {
SSkipList* slt = tbl->mem; SSkipList* slt = tbl->mem;
@ -418,16 +418,16 @@ void idxCacheDebug(IndexCache* cache) {
indexInfo("{colVal: %s, version: %" PRId64 "} \t", ct->colVal, ct->version); indexInfo("{colVal: %s, version: %" PRId64 "} \t", ct->colVal, ct->version);
} }
} }
(void)tSkipListDestroyIter(iter); TAOS_UNUSED(tSkipListDestroyIter(iter));
idxMemUnRef(tbl); idxMemUnRef(tbl);
} }
{ {
(void)taosThreadMutexLock(&cache->mtx); TAOS_UNUSED(taosThreadMutexLock(&cache->mtx));
tbl = cache->imm; tbl = cache->imm;
idxMemRef(tbl); idxMemRef(tbl);
(void)taosThreadMutexUnlock(&cache->mtx); TAOS_UNUSED(taosThreadMutexUnlock(&cache->mtx));
if (tbl != NULL) { if (tbl != NULL) {
SSkipList* slt = tbl->mem; SSkipList* slt = tbl->mem;
SSkipListIterator* iter = tSkipListCreateIter(slt); SSkipListIterator* iter = tSkipListCreateIter(slt);
@ -439,7 +439,7 @@ void idxCacheDebug(IndexCache* cache) {
indexInfo("{colVal: %s, version: %" PRId64 "} \t", ct->colVal, ct->version); indexInfo("{colVal: %s, version: %" PRId64 "} \t", ct->colVal, ct->version);
} }
} }
(void)tSkipListDestroyIter(iter); TAOS_UNUSED(tSkipListDestroyIter(iter));
} }
idxMemUnRef(tbl); idxMemUnRef(tbl);
@ -456,29 +456,29 @@ void idxCacheDestroySkiplist(SSkipList* slt) {
taosMemoryFree(ct); taosMemoryFree(ct);
} }
} }
(void)tSkipListDestroyIter(iter); TAOS_UNUSED(tSkipListDestroyIter(iter));
tSkipListDestroy(slt); tSkipListDestroy(slt);
} }
void idxCacheBroadcast(void* cache) { void idxCacheBroadcast(void* cache) {
IndexCache* pCache = cache; IndexCache* pCache = cache;
(void)taosThreadCondBroadcast(&pCache->finished); TAOS_UNUSED(taosThreadCondBroadcast(&pCache->finished));
} }
void idxCacheWait(void* cache) { void idxCacheWait(void* cache) {
IndexCache* pCache = cache; IndexCache* pCache = cache;
(void)taosThreadCondWait(&pCache->finished, &pCache->mtx); TAOS_UNUSED(taosThreadCondWait(&pCache->finished, &pCache->mtx));
} }
void idxCacheDestroyImm(IndexCache* cache) { void idxCacheDestroyImm(IndexCache* cache) {
if (cache == NULL) { if (cache == NULL) {
return; return;
} }
MemTable* tbl = NULL; MemTable* tbl = NULL;
(void)taosThreadMutexLock(&cache->mtx); TAOS_UNUSED(taosThreadMutexLock(&cache->mtx));
tbl = cache->imm; tbl = cache->imm;
cache->imm = NULL; // or throw int bg thread cache->imm = NULL; // or throw int bg thread
idxCacheBroadcast(cache); idxCacheBroadcast(cache);
(void)taosThreadMutexUnlock(&cache->mtx); TAOS_UNUSED(taosThreadMutexUnlock(&cache->mtx));
idxMemUnRef(tbl); idxMemUnRef(tbl);
idxMemUnRef(tbl); idxMemUnRef(tbl);
@ -493,8 +493,8 @@ void idxCacheDestroy(void* cache) {
idxMemUnRef(pCache->imm); idxMemUnRef(pCache->imm);
taosMemoryFree(pCache->colName); taosMemoryFree(pCache->colName);
(void)taosThreadMutexDestroy(&pCache->mtx); TAOS_UNUSED(taosThreadMutexDestroy(&pCache->mtx));
(void)taosThreadCondDestroy(&pCache->finished); TAOS_UNUSED(taosThreadCondDestroy(&pCache->finished));
if (pCache->index != NULL) { if (pCache->index != NULL) {
idxReleaseRef(((SIndex*)pCache->index)->refId); idxReleaseRef(((SIndex*)pCache->index)->refId);
} }
@ -509,7 +509,7 @@ Iterate* idxCacheIteratorCreate(IndexCache* cache) {
if (iter == NULL) { if (iter == NULL) {
return NULL; return NULL;
} }
(void)taosThreadMutexLock(&cache->mtx); TAOS_UNUSED(taosThreadMutexLock(&cache->mtx));
idxMemRef(cache->imm); idxMemRef(cache->imm);
@ -520,7 +520,7 @@ Iterate* idxCacheIteratorCreate(IndexCache* cache) {
iter->next = idxCacheIteratorNext; iter->next = idxCacheIteratorNext;
iter->getValue = idxCacheIteratorGetValue; iter->getValue = idxCacheIteratorGetValue;
(void)taosThreadMutexUnlock(&cache->mtx); TAOS_UNUSED(taosThreadMutexUnlock(&cache->mtx));
return iter; return iter;
} }
@ -528,7 +528,7 @@ void idxCacheIteratorDestroy(Iterate* iter) {
if (iter == NULL) { if (iter == NULL) {
return; return;
} }
(void)tSkipListDestroyIter(iter->iter); TAOS_UNUSED(tSkipListDestroyIter(iter->iter));
iterateValueDestroy(&iter->val, true); iterateValueDestroy(&iter->val, true);
taosMemoryFree(iter); taosMemoryFree(iter);
} }
@ -542,7 +542,7 @@ int idxCacheSchedToMerge(IndexCache* pCache, bool notify) {
} }
schedMsg.msg = NULL; schedMsg.msg = NULL;
idxAcquireRef(pCache->index->refId); idxAcquireRef(pCache->index->refId);
(void)taosScheduleTask(indexQhandle, &schedMsg); TAOS_UNUSED(taosScheduleTask(indexQhandle, &schedMsg));
return 0; return 0;
} }
@ -567,7 +567,7 @@ static void idxCacheMakeRoomForWrite(IndexCache* cache) {
} }
// 1. sched to merge // 1. sched to merge
// 2. unref cache in bgwork // 2. unref cache in bgwork
(void)idxCacheSchedToMerge(cache, quit); TAOS_UNUSED(idxCacheSchedToMerge(cache, quit));
} }
} }
} }
@ -603,15 +603,15 @@ int idxCachePut(void* cache, SIndexTerm* term, uint64_t uid) {
// ugly code, refactor later // ugly code, refactor later
int64_t estimate = sizeof(ct) + strlen(ct->colVal); int64_t estimate = sizeof(ct) + strlen(ct->colVal);
(void)taosThreadMutexLock(&pCache->mtx); TAOS_UNUSED(taosThreadMutexLock(&pCache->mtx));
pCache->occupiedMem += estimate; pCache->occupiedMem += estimate;
idxCacheMakeRoomForWrite(pCache); idxCacheMakeRoomForWrite(pCache);
MemTable* tbl = pCache->mem; MemTable* tbl = pCache->mem;
idxMemRef(tbl); idxMemRef(tbl);
(void)tSkipListPut(tbl->mem, (char*)ct); TAOS_UNUSED(tSkipListPut(tbl->mem, (char*)ct));
idxMemUnRef(tbl); idxMemUnRef(tbl);
(void)taosThreadMutexUnlock(&pCache->mtx); TAOS_UNUSED(taosThreadMutexUnlock(&pCache->mtx));
idxCacheUnRef(pCache); idxCacheUnRef(pCache);
return 0; return 0;
} }
@ -619,13 +619,13 @@ void idxCacheForceToMerge(void* cache) {
IndexCache* pCache = cache; IndexCache* pCache = cache;
idxCacheRef(pCache); idxCacheRef(pCache);
(void)taosThreadMutexLock(&pCache->mtx); TAOS_UNUSED(taosThreadMutexLock(&pCache->mtx));
indexInfo("%p is forced to merge into tfile", pCache); indexInfo("%p is forced to merge into tfile", pCache);
pCache->occupiedMem += MEM_SIGNAL_QUIT; pCache->occupiedMem += MEM_SIGNAL_QUIT;
idxCacheMakeRoomForWrite(pCache); idxCacheMakeRoomForWrite(pCache);
(void)taosThreadMutexUnlock(&pCache->mtx); TAOS_UNUSED(taosThreadMutexUnlock(&pCache->mtx));
idxCacheUnRef(pCache); idxCacheUnRef(pCache);
return; return;
} }
@ -656,12 +656,12 @@ int idxCacheSearch(void* cache, SIndexTermQuery* query, SIdxTRslt* result, STerm
IndexCache* pCache = cache; IndexCache* pCache = cache;
MemTable *mem = NULL, *imm = NULL; MemTable *mem = NULL, *imm = NULL;
(void)taosThreadMutexLock(&pCache->mtx); TAOS_UNUSED(taosThreadMutexLock(&pCache->mtx));
mem = pCache->mem; mem = pCache->mem;
imm = pCache->imm; imm = pCache->imm;
idxMemRef(mem); idxMemRef(mem);
idxMemRef(imm); idxMemRef(imm);
(void)taosThreadMutexUnlock(&pCache->mtx); TAOS_UNUSED(taosThreadMutexUnlock(&pCache->mtx));
int64_t st = taosGetTimestampUs(); int64_t st = taosGetTimestampUs();
@ -797,7 +797,7 @@ static void idxDoMergeWork(SSchedMsg* msg) {
int quit = msg->thandle ? true : false; int quit = msg->thandle ? true : false;
taosMemoryFree(msg->thandle); taosMemoryFree(msg->thandle);
(void)idxFlushCacheToTFile(sidx, pCache, quit); TAOS_UNUSED(idxFlushCacheToTFile(sidx, pCache, quit));
} }
static bool idxCacheIteratorNext(Iterate* itera) { static bool idxCacheIteratorNext(Iterate* itera) {
SSkipListIterator* iter = itera->iter; SSkipListIterator* iter = itera->iter;

View File

@ -349,7 +349,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
if (*dst == NULL) { if (*dst == NULL) {
return terrno; return terrno;
} }
(void)idxInt2str(*(int64_t*)src, *dst, -1); TAOS_UNUSED(idxInt2str(*(int64_t*)src, *dst, -1));
tlen = strlen(*dst); tlen = strlen(*dst);
break; break;
case TSDB_DATA_TYPE_BOOL: case TSDB_DATA_TYPE_BOOL:
@ -358,7 +358,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
if (*dst == NULL) { if (*dst == NULL) {
return terrno; return terrno;
} }
(void)idxInt2str(*(uint8_t*)src, *dst, 1); TAOS_UNUSED(idxInt2str(*(uint8_t*)src, *dst, 1));
tlen = strlen(*dst); tlen = strlen(*dst);
break; break;
case TSDB_DATA_TYPE_TINYINT: case TSDB_DATA_TYPE_TINYINT:
@ -366,7 +366,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
if (*dst == NULL) { if (*dst == NULL) {
return terrno; return terrno;
} }
(void)idxInt2str(*(int8_t*)src, *dst, 1); TAOS_UNUSED(idxInt2str(*(int8_t*)src, *dst, 1));
tlen = strlen(*dst); tlen = strlen(*dst);
break; break;
case TSDB_DATA_TYPE_SMALLINT: case TSDB_DATA_TYPE_SMALLINT:
@ -374,12 +374,12 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
if (*dst == NULL) { if (*dst == NULL) {
return terrno; return terrno;
} }
(void)idxInt2str(*(int16_t*)src, *dst, -1); TAOS_UNUSED(idxInt2str(*(int16_t*)src, *dst, -1));
tlen = strlen(*dst); tlen = strlen(*dst);
break; break;
case TSDB_DATA_TYPE_USMALLINT: case TSDB_DATA_TYPE_USMALLINT:
*dst = taosMemoryCalloc(1, bufSize + 1); *dst = taosMemoryCalloc(1, bufSize + 1);
(void)idxInt2str(*(uint16_t*)src, *dst, -1); TAOS_UNUSED(idxInt2str(*(uint16_t*)src, *dst, -1));
tlen = strlen(*dst); tlen = strlen(*dst);
break; break;
case TSDB_DATA_TYPE_INT: case TSDB_DATA_TYPE_INT:
@ -387,7 +387,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
if (*dst == NULL) { if (*dst == NULL) {
return terrno; return terrno;
} }
(void)idxInt2str(*(int32_t*)src, *dst, -1); TAOS_UNUSED(idxInt2str(*(int32_t*)src, *dst, -1));
tlen = strlen(*dst); tlen = strlen(*dst);
break; break;
case TSDB_DATA_TYPE_UINT: case TSDB_DATA_TYPE_UINT:
@ -395,7 +395,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
if (*dst == NULL) { if (*dst == NULL) {
return terrno; return terrno;
} }
(void)idxInt2str(*(uint32_t*)src, *dst, 1); TAOS_UNUSED(idxInt2str(*(uint32_t*)src, *dst, 1));
tlen = strlen(*dst); tlen = strlen(*dst);
break; break;
case TSDB_DATA_TYPE_BIGINT: case TSDB_DATA_TYPE_BIGINT:
@ -411,7 +411,7 @@ int32_t idxConvertDataToStr(void* src, int8_t type, void** dst) {
if (*dst == NULL) { if (*dst == NULL) {
return terrno; return terrno;
} }
(void)idxInt2str(*(uint64_t*)src, *dst, 1); TAOS_UNUSED(idxInt2str(*(uint64_t*)src, *dst, 1));
tlen = strlen(*dst); tlen = strlen(*dst);
break; break;
case TSDB_DATA_TYPE_FLOAT: case TSDB_DATA_TYPE_FLOAT:

View File

@ -1057,7 +1057,7 @@ static int32_t sifCalculate(SNode *pNode, SIFParam *pDst) {
pDst->status = res->status; pDst->status = res->status;
sifFreeParam(res); sifFreeParam(res);
(void)taosHashRemove(ctx.pRes, (void *)&pNode, POINTER_BYTES); TAOS_UNUSED(taosHashRemove(ctx.pRes, (void *)&pNode, POINTER_BYTES));
} }
sifFreeRes(ctx.pRes); sifFreeRes(ctx.pRes);
return code; return code;
@ -1089,7 +1089,7 @@ static int32_t sifGetFltHint(SNode *pNode, SIdxFltStatus *status, SMetaDataFilte
} }
*status = res->status; *status = res->status;
sifFreeParam(res); sifFreeParam(res);
(void)taosHashRemove(ctx.pRes, (void *)&pNode, POINTER_BYTES); TAOS_UNUSED(taosHashRemove(ctx.pRes, (void *)&pNode, POINTER_BYTES));
void *iter = taosHashIterate(ctx.pRes, NULL); void *iter = taosHashIterate(ctx.pRes, NULL);
while (iter != NULL) { while (iter != NULL) {

View File

@ -219,9 +219,9 @@ void fstStateCompileForOneTransNext(IdxFstFile* w, CompiledAddr addr, uint8_t in
uint8_t v = fstStateCommInput(&s, &null); uint8_t v = fstStateCommInput(&s, &null);
if (null) { if (null) {
// w->write_all(&[inp]) // w->write_all(&[inp])
(void)idxFileWrite(w, &inp, 1); TAOS_UNUSED(idxFileWrite(w, &inp, 1));
} }
(void)idxFileWrite(w, &(s.val), 1); TAOS_UNUSED(idxFileWrite(w, &(s.val), 1));
// w->write_all(&[s.val]) // w->write_all(&[s.val])
return; return;
} }
@ -233,7 +233,7 @@ void fstStateCompileForOneTrans(IdxFstFile* w, CompiledAddr addr, FstTransition*
FST_SET_OUTPUT_PACK_SIZE(packSizes, outPackSize); FST_SET_OUTPUT_PACK_SIZE(packSizes, outPackSize);
FST_SET_TRANSITION_PACK_SIZE(packSizes, transPackSize); FST_SET_TRANSITION_PACK_SIZE(packSizes, transPackSize);
(void)idxFileWrite(w, (char*)&packSizes, sizeof(packSizes)); TAOS_UNUSED(idxFileWrite(w, (char*)&packSizes, sizeof(packSizes)));
FstState st = fstStateCreate(OneTrans); FstState st = fstStateCreate(OneTrans);
@ -242,9 +242,9 @@ void fstStateCompileForOneTrans(IdxFstFile* w, CompiledAddr addr, FstTransition*
bool null = false; bool null = false;
uint8_t inp = fstStateCommInput(&st, &null); uint8_t inp = fstStateCommInput(&st, &null);
if (null == true) { if (null == true) {
(void)idxFileWrite(w, (char*)&trn->inp, sizeof(trn->inp)); TAOS_UNUSED(idxFileWrite(w, (char*)&trn->inp, sizeof(trn->inp)));
} }
(void)idxFileWrite(w, (char*)(&(st.val)), sizeof(st.val)); TAOS_UNUSED(idxFileWrite(w, (char*)(&(st.val)), sizeof(st.val)));
return; return;
} }
void fstStateCompileForAnyTrans(IdxFstFile* w, CompiledAddr addr, FstBuilderNode* node) { void fstStateCompileForAnyTrans(IdxFstFile* w, CompiledAddr addr, FstBuilderNode* node) {
@ -290,7 +290,7 @@ void fstStateCompileForAnyTrans(IdxFstFile* w, CompiledAddr addr, FstBuilderNode
} }
for (int32_t i = sz - 1; i >= 0; i--) { for (int32_t i = sz - 1; i >= 0; i--) {
FstTransition* t = taosArrayGet(node->trans, i); FstTransition* t = taosArrayGet(node->trans, i);
(void)idxFileWrite(w, (char*)&t->inp, 1); TAOS_UNUSED(idxFileWrite(w, (char*)&t->inp, 1));
} }
if (sz > TRANS_INDEX_THRESHOLD) { if (sz > TRANS_INDEX_THRESHOLD) {
// A value of 255 indicates that no transition exists for the byte at that idx // A value of 255 indicates that no transition exists for the byte at that idx
@ -300,24 +300,24 @@ void fstStateCompileForAnyTrans(IdxFstFile* w, CompiledAddr addr, FstBuilderNode
FstTransition* t = taosArrayGet(node->trans, i); FstTransition* t = taosArrayGet(node->trans, i);
index[t->inp] = i; index[t->inp] = i;
} }
(void)idxFileWrite(w, (char*)index, 256); TAOS_UNUSED(idxFileWrite(w, (char*)index, 256));
taosMemoryFree(index); taosMemoryFree(index);
} }
(void)idxFileWrite(w, (char*)&packSizes, 1); TAOS_UNUSED(idxFileWrite(w, (char*)&packSizes, 1));
bool null = false; bool null = false;
(void)fstStateStateNtrans(&st, &null); TAOS_UNUSED(fstStateStateNtrans(&st, &null));
if (null == true) { if (null == true) {
// 256 can't be represented in a u8, so we abuse the fact that // 256 can't be represented in a u8, so we abuse the fact that
// the # of transitions can never be 1 here, since 1 is always // the # of transitions can never be 1 here, since 1 is always
// encoded in the state byte. // encoded in the state byte.
uint8_t v = 1; uint8_t v = 1;
if (sz == 256) { if (sz == 256) {
(void)idxFileWrite(w, (char*)&v, 1); TAOS_UNUSED(idxFileWrite(w, (char*)&v, 1));
} else { } else {
(void)idxFileWrite(w, (char*)&sz, 1); TAOS_UNUSED(idxFileWrite(w, (char*)&sz, 1));
} }
} }
(void)idxFileWrite(w, (char*)(&(st.val)), 1); TAOS_UNUSED(idxFileWrite(w, (char*)(&(st.val)), 1));
return; return;
} }
@ -343,7 +343,7 @@ uint8_t fstStateCommInput(FstState* s, bool* null) {
uint64_t fstStateInputLen(FstState* s) { uint64_t fstStateInputLen(FstState* s) {
bool null = false; bool null = false;
(void)fstStateCommInput(s, &null); TAOS_UNUSED(fstStateCommInput(s, &null));
return null ? 1 : 0; return null ? 1 : 0;
} }
@ -479,7 +479,7 @@ uint64_t fstStateTransIndexSize(FstState* s, uint64_t version, uint64_t nTrans)
} }
uint64_t fstStateNtransLen(FstState* s) { uint64_t fstStateNtransLen(FstState* s) {
bool null = false; bool null = false;
(void)fstStateStateNtrans(s, &null); TAOS_UNUSED(fstStateStateNtrans(s, &null));
return null == true ? 1 : 0; return null == true ? 1 : 0;
} }
uint64_t fstStateNtrans(FstState* s, FstSlice* slice) { uint64_t fstStateNtrans(FstState* s, FstSlice* slice) {
@ -651,11 +651,11 @@ bool fstNodeGetTransitionAddrAt(FstNode* node, uint64_t i, CompiledAddr* res) {
bool s = true; bool s = true;
FstState* st = &node->state; FstState* st = &node->state;
if (st->state == OneTransNext) { if (st->state == OneTransNext) {
(void)fstStateTransAddr(st, node); TAOS_UNUSED(fstStateTransAddr(st, node));
} else if (st->state == OneTrans) { } else if (st->state == OneTrans) {
(void)fstStateTransAddr(st, node); TAOS_UNUSED(fstStateTransAddr(st, node));
} else if (st->state == AnyTrans) { } else if (st->state == AnyTrans) {
(void)fstStateTransAddrForAnyTrans(st, node, i); TAOS_UNUSED(fstStateTransAddrForAnyTrans(st, node, i));
} else if (FST_STATE_EMPTY_FINAL(node)) { } else if (FST_STATE_EMPTY_FINAL(node)) {
s = false; s = false;
} else { } else {
@ -730,13 +730,13 @@ FstBuilder* fstBuilderCreate(void* w, FstType ty) {
char buf64[8] = {0}; char buf64[8] = {0};
void* pBuf64 = buf64; void* pBuf64 = buf64;
(void)taosEncodeFixedU64(&pBuf64, VERSION); TAOS_UNUSED(taosEncodeFixedU64(&pBuf64, VERSION));
(void)idxFileWrite(b->wrt, buf64, sizeof(buf64)); TAOS_UNUSED(idxFileWrite(b->wrt, buf64, sizeof(buf64)));
pBuf64 = buf64; pBuf64 = buf64;
memset(buf64, 0, sizeof(buf64)); memset(buf64, 0, sizeof(buf64));
(void)taosEncodeFixedU64(&pBuf64, ty); TAOS_UNUSED(taosEncodeFixedU64(&pBuf64, ty));
(void)idxFileWrite(b->wrt, buf64, sizeof(buf64)); TAOS_UNUSED(idxFileWrite(b->wrt, buf64, sizeof(buf64)));
return b; return b;
} }
@ -835,7 +835,7 @@ CompiledAddr fstBuilderCompile(FstBuilder* b, FstBuilderNode* bn) {
} }
CompiledAddr startAddr = (CompiledAddr)(FST_WRITER_COUNT(b->wrt)); CompiledAddr startAddr = (CompiledAddr)(FST_WRITER_COUNT(b->wrt));
(void)fstBuilderNodeCompileTo(bn, b->wrt, b->lastAddr, startAddr); TAOS_UNUSED(fstBuilderNodeCompileTo(bn, b->wrt, b->lastAddr, startAddr));
b->lastAddr = (CompiledAddr)(FST_WRITER_COUNT(b->wrt) - 1); b->lastAddr = (CompiledAddr)(FST_WRITER_COUNT(b->wrt) - 1);
if (entry->state == NOTFOUND) { if (entry->state == NOTFOUND) {
FST_REGISTRY_CELL_INSERT(entry->cell, b->lastAddr); FST_REGISTRY_CELL_INSERT(entry->cell, b->lastAddr);
@ -854,23 +854,23 @@ void* fstBuilderInsertInner(FstBuilder* b) {
char buf64[8] = {0}; char buf64[8] = {0};
void* pBuf64 = buf64; void* pBuf64 = buf64;
(void)taosEncodeFixedU64(&pBuf64, b->len); TAOS_UNUSED(taosEncodeFixedU64(&pBuf64, b->len));
(void)idxFileWrite(b->wrt, buf64, sizeof(buf64)); TAOS_UNUSED(idxFileWrite(b->wrt, buf64, sizeof(buf64)));
pBuf64 = buf64; pBuf64 = buf64;
(void)taosEncodeFixedU64(&pBuf64, rootAddr); TAOS_UNUSED(taosEncodeFixedU64(&pBuf64, rootAddr));
(void)idxFileWrite(b->wrt, buf64, sizeof(buf64)); TAOS_UNUSED(idxFileWrite(b->wrt, buf64, sizeof(buf64)));
char buf32[4] = {0}; char buf32[4] = {0};
void* pBuf32 = buf32; void* pBuf32 = buf32;
uint32_t sum = idxFileMaskedCheckSum(b->wrt); uint32_t sum = idxFileMaskedCheckSum(b->wrt);
(void)taosEncodeFixedU32(&pBuf32, sum); TAOS_UNUSED(taosEncodeFixedU32(&pBuf32, sum));
(void)idxFileWrite(b->wrt, buf32, sizeof(buf32)); TAOS_UNUSED(idxFileWrite(b->wrt, buf32, sizeof(buf32)));
(void)idxFileFlush(b->wrt); TAOS_UNUSED(idxFileFlush(b->wrt));
return b->wrt; return b->wrt;
} }
void fstBuilderFinish(FstBuilder* b) { (void)fstBuilderInsertInner(b); } void fstBuilderFinish(FstBuilder* b) { TAOS_UNUSED(fstBuilderInsertInner(b)); }
FstSlice fstNodeAsSlice(FstNode* node) { FstSlice fstNodeAsSlice(FstNode* node) {
FstSlice* slice = &node->data; FstSlice* slice = &node->data;
@ -930,19 +930,19 @@ Fst* fstCreate(FstSlice* slice) {
uint64_t skip = 0; uint64_t skip = 0;
uint64_t version; uint64_t version;
(void)taosDecodeFixedU64(buf, &version); TAOS_UNUSED(taosDecodeFixedU64(buf, &version));
skip += sizeof(version); skip += sizeof(version);
if (version == 0 || version > VERSION) { if (version == 0 || version > VERSION) {
return NULL; return NULL;
} }
uint64_t type; uint64_t type;
(void)taosDecodeFixedU64(buf + skip, &type); TAOS_UNUSED(taosDecodeFixedU64(buf + skip, &type));
skip += sizeof(type); skip += sizeof(type);
uint32_t checkSum = 0; uint32_t checkSum = 0;
len -= sizeof(checkSum); len -= sizeof(checkSum);
(void)taosDecodeFixedU32(buf + len, &checkSum); TAOS_UNUSED(taosDecodeFixedU32(buf + len, &checkSum));
if (taosCheckChecksum(buf, len, checkSum)) { if (taosCheckChecksum(buf, len, checkSum)) {
indexError("index file is corrupted"); indexError("index file is corrupted");
// verify fst // verify fst
@ -950,11 +950,11 @@ Fst* fstCreate(FstSlice* slice) {
} }
CompiledAddr rootAddr; CompiledAddr rootAddr;
len -= sizeof(rootAddr); len -= sizeof(rootAddr);
(void)taosDecodeFixedU64(buf + len, &rootAddr); TAOS_UNUSED(taosDecodeFixedU64(buf + len, &rootAddr));
uint64_t fstLen; uint64_t fstLen;
len -= sizeof(fstLen); len -= sizeof(fstLen);
(void)taosDecodeFixedU64(buf + len, &fstLen); TAOS_UNUSED(taosDecodeFixedU64(buf + len, &fstLen));
// TODO(validate root addr) // TODO(validate root addr)
Fst* fst = (Fst*)taosMemoryCalloc(1, sizeof(Fst)); Fst* fst = (Fst*)taosMemoryCalloc(1, sizeof(Fst));
if (fst == NULL) { if (fst == NULL) {
@ -976,7 +976,7 @@ Fst* fstCreate(FstSlice* slice) {
*s = fstSliceCopy(slice, 0, FST_SLICE_LEN(slice) - 1); *s = fstSliceCopy(slice, 0, FST_SLICE_LEN(slice) - 1);
fst->data = s; fst->data = s;
(void)taosThreadMutexInit(&fst->mtx, NULL); TAOS_UNUSED(taosThreadMutexInit(&fst->mtx, NULL));
return fst; return fst;
FST_CREAT_FAILED: FST_CREAT_FAILED:
@ -990,7 +990,7 @@ void fstDestroy(Fst* fst) {
taosMemoryFree(fst->meta); taosMemoryFree(fst->meta);
fstSliceDestroy(fst->data); fstSliceDestroy(fst->data);
taosMemoryFree(fst->data); taosMemoryFree(fst->data);
(void)taosThreadMutexDestroy(&fst->mtx); TAOS_UNUSED(taosThreadMutexDestroy(&fst->mtx));
} }
taosMemoryFree(fst); taosMemoryFree(fst);
} }
@ -1018,7 +1018,7 @@ bool fstGet(Fst* fst, FstSlice* b, Output* out) {
} }
FstTransition trn; FstTransition trn;
(void)fstNodeGetTransitionAt(root, res, &trn); TAOS_UNUSED(fstNodeGetTransitionAt(root, res, &trn));
tOut += trn.out; tOut += trn.out;
root = fstGetNode(fst, trn.addr); root = fstGetNode(fst, trn.addr);
if (taosArrayPush(nodes, &root) == NULL) { if (taosArrayPush(nodes, &root) == NULL) {
@ -1145,7 +1145,7 @@ FStmSt* stmStCreate(Fst* fst, FAutoCtx* automation, FstBoundWithData* min, FstBo
sws->stack = (SArray*)taosArrayInit(256, sizeof(FstStreamState)); sws->stack = (SArray*)taosArrayInit(256, sizeof(FstStreamState));
sws->endAt = max; sws->endAt = max;
(void)stmStSeekMin(sws, min); TAOS_UNUSED(stmStSeekMin(sws, min));
return sws; return sws;
} }
@ -1198,7 +1198,7 @@ bool stmStSeekMin(FStmSt* sws, FstBoundWithData* min) {
uint64_t res = 0; uint64_t res = 0;
if (fstNodeFindInput(node, b, &res)) { if (fstNodeFindInput(node, b, &res)) {
FstTransition trn; FstTransition trn;
(void)fstNodeGetTransitionAt(node, res, &trn); TAOS_UNUSED(fstNodeGetTransitionAt(node, res, &trn));
void* preState = autState; void* preState = autState;
autState = automFuncs[aut->type].accept(aut, preState, b); autState = automFuncs[aut->type].accept(aut, preState, b);
if (taosArrayPush(sws->inp, &b) == NULL) { if (taosArrayPush(sws->inp, &b) == NULL) {
@ -1244,12 +1244,12 @@ bool stmStSeekMin(FStmSt* sws, FstBoundWithData* min) {
FstStreamState* s = taosArrayGet(sws->stack, sz - 1); FstStreamState* s = taosArrayGet(sws->stack, sz - 1);
if (inclusize) { if (inclusize) {
s->trans -= 1; s->trans -= 1;
(void)taosArrayPop(sws->inp); TAOS_UNUSED(taosArrayPop(sws->inp));
} else { } else {
FstNode* n = s->node; FstNode* n = s->node;
uint64_t trans = s->trans; uint64_t trans = s->trans;
FstTransition trn; FstTransition trn;
(void)fstNodeGetTransitionAt(n, trans - 1, &trn); TAOS_UNUSED(fstNodeGetTransitionAt(n, trans - 1, &trn));
FstStreamState s = { FstStreamState s = {
.node = fstGetNode(sws->fst, trn.addr), .trans = 0, .out = {.null = false, .out = out}, .autState = autState}; .node = fstGetNode(sws->fst, trn.addr), .trans = 0, .out = {.null = false, .out = out}, .autState = autState};
if (taosArrayPush(sws->stack, &s) == NULL) { if (taosArrayPush(sws->stack, &s) == NULL) {
@ -1283,13 +1283,13 @@ FStmStRslt* stmStNextWith(FStmSt* sws, streamCallback__fn callback) {
FstStreamState* p = (FstStreamState*)taosArrayPop(sws->stack); FstStreamState* p = (FstStreamState*)taosArrayPop(sws->stack);
if (p->trans >= FST_NODE_LEN(p->node) || !automFuncs[aut->type].canMatch(aut, p->autState)) { if (p->trans >= FST_NODE_LEN(p->node) || !automFuncs[aut->type].canMatch(aut, p->autState)) {
if (FST_NODE_ADDR(p->node) != fstGetRootAddr(sws->fst)) { if (FST_NODE_ADDR(p->node) != fstGetRootAddr(sws->fst)) {
(void)taosArrayPop(sws->inp); TAOS_UNUSED(taosArrayPop(sws->inp));
} }
fstStreamStateDestroy(p); fstStreamStateDestroy(p);
continue; continue;
} }
FstTransition trn; FstTransition trn;
(void)fstNodeGetTransitionAt(p->node, p->trans, &trn); TAOS_UNUSED(fstNodeGetTransitionAt(p->node, p->trans, &trn));
Output out = p->out.out + trn.out; Output out = p->out.out + trn.out;
void* nextState = automFuncs[aut->type].accept(aut, p->autState, trn.inp); void* nextState = automFuncs[aut->type].accept(aut, p->autState, trn.inp);

View File

@ -132,7 +132,7 @@ bool dfaBuilderRunState(FstDfaBuilder *builder, FstSparseSet *cur, FstSparseSet
bool succ = sparSetAdd(cur, ip, NULL); bool succ = sparSetAdd(cur, ip, NULL);
if (succ == false) return false; if (succ == false) return false;
} }
(void)dfaRun(builder->dfa, cur, next, byte); TAOS_UNUSED(dfaRun(builder->dfa, cur, next, byte));
t = taosArrayGet(builder->dfa->states, state); t = taosArrayGet(builder->dfa->states, state);

View File

@ -30,7 +30,9 @@ typedef struct {
} SDataBlock; } SDataBlock;
static void deleteDataBlockFromLRU(const void* key, size_t keyLen, void* value, void* ud) { static void deleteDataBlockFromLRU(const void* key, size_t keyLen, void* value, void* ud) {
(void)ud; TAOS_UNUSED(ud);
TAOS_UNUSED(key);
TAOS_UNUSED(keyLen);
taosMemoryFree(value); taosMemoryFree(value);
} }
@ -38,7 +40,7 @@ static FORCE_INLINE void idxGenLRUKey(char* buf, const char* path, int32_t block
char* p = buf; char* p = buf;
SERIALIZE_STR_VAR_TO_BUF(p, path, strlen(path)); SERIALIZE_STR_VAR_TO_BUF(p, path, strlen(path));
SERIALIZE_VAR_TO_BUF(p, '_', char); SERIALIZE_VAR_TO_BUF(p, '_', char);
(void)idxInt2str(blockId, p, 0); TAOS_UNUSED(idxInt2str(blockId, p, 0));
return; return;
} }
static FORCE_INLINE int idxFileCtxDoWrite(IFileCtx* ctx, uint8_t* buf, int len) { static FORCE_INLINE int idxFileCtxDoWrite(IFileCtx* ctx, uint8_t* buf, int len) {
@ -48,7 +50,7 @@ static FORCE_INLINE int idxFileCtxDoWrite(IFileCtx* ctx, uint8_t* buf, int len)
if (len + ctx->file.wBufOffset >= cap) { if (len + ctx->file.wBufOffset >= cap) {
int32_t nw = cap - ctx->file.wBufOffset; int32_t nw = cap - ctx->file.wBufOffset;
memcpy(ctx->file.wBuf + ctx->file.wBufOffset, buf, nw); memcpy(ctx->file.wBuf + ctx->file.wBufOffset, buf, nw);
(void)taosWriteFile(ctx->file.pFile, ctx->file.wBuf, cap); TAOS_UNUSED(taosWriteFile(ctx->file.pFile, ctx->file.wBuf, cap));
memset(ctx->file.wBuf, 0, cap); memset(ctx->file.wBuf, 0, cap);
ctx->file.wBufOffset = 0; ctx->file.wBufOffset = 0;
@ -58,7 +60,7 @@ static FORCE_INLINE int idxFileCtxDoWrite(IFileCtx* ctx, uint8_t* buf, int len)
nw = (len / cap) * cap; nw = (len / cap) * cap;
if (nw != 0) { if (nw != 0) {
(void)taosWriteFile(ctx->file.pFile, buf, nw); TAOS_UNUSED(taosWriteFile(ctx->file.pFile, buf, nw));
} }
len -= nw; len -= nw;
@ -115,7 +117,7 @@ static int idxFileCtxDoReadFrom(IFileCtx* ctx, uint8_t* buf, int len, int32_t of
SDataBlock* blk = taosLRUCacheValue(ctx->lru, h); SDataBlock* blk = taosLRUCacheValue(ctx->lru, h);
nread = TMIN(blkLeft, len); nread = TMIN(blkLeft, len);
memcpy(buf + total, blk->buf + blkOffset, nread); memcpy(buf + total, blk->buf + blkOffset, nread);
(void)taosLRUCacheRelease(ctx->lru, h, false); TAOS_UNUSED(taosLRUCacheRelease(ctx->lru, h, false));
} else { } else {
int32_t left = ctx->file.size - offset; int32_t left = ctx->file.size - offset;
if (left < kBlockSize) { if (left < kBlockSize) {
@ -166,7 +168,7 @@ static FORCE_INLINE int idxFileCtxGetSize(IFileCtx* ctx) {
return ctx->offset; return ctx->offset;
} else { } else {
int64_t file_size = 0; int64_t file_size = 0;
(void)taosStatFile(ctx->file.buf, &file_size, NULL, NULL); TAOS_UNUSED(taosStatFile(ctx->file.buf, &file_size, NULL, NULL));
return (int)file_size; return (int)file_size;
} }
} }
@ -254,16 +256,16 @@ void idxFileCtxDestroy(IFileCtx* ctx, bool remove) {
int32_t nw = taosWriteFile(ctx->file.pFile, ctx->file.wBuf, ctx->file.wBufOffset); int32_t nw = taosWriteFile(ctx->file.pFile, ctx->file.wBuf, ctx->file.wBufOffset);
ctx->file.wBufOffset = 0; ctx->file.wBufOffset = 0;
} }
(void)(ctx->flush(ctx)); TAOS_UNUSED(ctx->flush(ctx));
taosMemoryFreeClear(ctx->file.wBuf); taosMemoryFreeClear(ctx->file.wBuf);
(void)taosCloseFile(&ctx->file.pFile); TAOS_UNUSED(taosCloseFile(&ctx->file.pFile));
if (ctx->file.readOnly) { if (ctx->file.readOnly) {
#ifdef USE_MMAP #ifdef USE_MMAP
munmap(ctx->file.ptr, ctx->file.size); munmap(ctx->file.ptr, ctx->file.size);
#endif #endif
} }
if (remove) { if (remove) {
(void)unlink(ctx->file.buf); TAOS_UNUSED(unlink(ctx->file.buf));
} }
} }
taosMemoryFree(ctx); taosMemoryFree(ctx);
@ -279,7 +281,7 @@ IdxFstFile* idxFileCreate(void* wrt) {
return cw; return cw;
} }
void idxFileDestroy(IdxFstFile* cw) { void idxFileDestroy(IdxFstFile* cw) {
(void)idxFileFlush(cw); TAOS_UNUSED(idxFileFlush(cw));
taosMemoryFree(cw); taosMemoryFree(cw);
} }
@ -317,7 +319,7 @@ uint32_t idxFileMaskedCheckSum(IdxFstFile* write) {
int idxFileFlush(IdxFstFile* write) { int idxFileFlush(IdxFstFile* write) {
IFileCtx* ctx = write->wrt; IFileCtx* ctx = write->wrt;
(void)(ctx->flush(ctx)); TAOS_UNUSED(ctx->flush(ctx));
return 1; return 1;
} }
@ -327,7 +329,7 @@ void idxFilePackUintIn(IdxFstFile* writer, uint64_t n, uint8_t nBytes) {
buf[i] = (uint8_t)n; buf[i] = (uint8_t)n;
n = n >> 8; n = n >> 8;
} }
(void)idxFileWrite(writer, buf, nBytes); TAOS_UNUSED(idxFileWrite(writer, buf, nBytes));
taosMemoryFree(buf); taosMemoryFree(buf);
return; return;
} }

View File

@ -128,7 +128,7 @@ FstRegistryEntry* fstRegistryGetEntry(FstRegistry* registry, FstBuilderNode* bNo
entry->addr = cell->addr; entry->addr = cell->addr;
return entry; return entry;
} else { } else {
(void)fstBuilderNodeCloneFrom(cell->node, bNode); TAOS_UNUSED(fstBuilderNodeCloneFrom(cell->node, bNode));
entry->state = NOTFOUND; entry->state = NOTFOUND;
entry->cell = cell; // copy or not entry->cell = cell; // copy or not
} }
@ -148,7 +148,7 @@ FstRegistryEntry* fstRegistryGetEntry(FstRegistry* registry, FstBuilderNode* bNo
return entry; return entry;
} }
// clone from bNode, refactor later // clone from bNode, refactor later
(void)fstBuilderNodeCloneFrom(cell2->node, bNode); TAOS_UNUSED(fstBuilderNodeCloneFrom(cell2->node, bNode));
fstRegistryCellSwap(registry->table, start, start + 1); fstRegistryCellSwap(registry->table, start, start + 1);
FstRegistryCell* cCell = taosArrayGet(registry->table, start); FstRegistryCell* cCell = taosArrayGet(registry->table, start);
@ -169,7 +169,7 @@ FstRegistryEntry* fstRegistryGetEntry(FstRegistry* registry, FstBuilderNode* bNo
uint64_t last = end - 1; uint64_t last = end - 1;
FstRegistryCell* cell = (FstRegistryCell*)taosArrayGet(registry->table, last); FstRegistryCell* cell = (FstRegistryCell*)taosArrayGet(registry->table, last);
// clone from bNode, refactor later // clone from bNode, refactor later
(void)fstBuilderNodeCloneFrom(cell->node, bNode); TAOS_UNUSED(fstBuilderNodeCloneFrom(cell->node, bNode));
fstRegistryCellPromote(registry->table, last, start); fstRegistryCellPromote(registry->table, last, start);
FstRegistryCell* cCell = taosArrayGet(registry->table, start); FstRegistryCell* cCell = taosArrayGet(registry->table, start);

View File

@ -91,7 +91,7 @@ FstSlice fstSliceCreate(uint8_t* data, uint64_t len) {
// just shallow copy // just shallow copy
FstSlice fstSliceCopy(FstSlice* s, int32_t start, int32_t end) { FstSlice fstSliceCopy(FstSlice* s, int32_t start, int32_t end) {
FstString* str = s->str; FstString* str = s->str;
(void)atomic_add_fetch_32(&str->ref, 1); TAOS_UNUSED(atomic_add_fetch_32(&str->ref, 1));
FstSlice t = {.str = str, .start = start + s->start, .end = end + s->start}; FstSlice t = {.str = str, .start = start + s->start, .end = end + s->start};
return t; return t;

View File

@ -374,7 +374,7 @@ static int32_t tfSearchCompareFunc(void* reader, SIndexTerm* tem, SIdxTRslt* tr,
goto _return; goto _return;
} }
if (MATCH == cond) { if (MATCH == cond) {
(void)tfileReaderLoadTableIds((TFileReader*)reader, rt->out.out, tr->total); TAOS_UNUSED(tfileReaderLoadTableIds((TFileReader*)reader, rt->out.out, tr->total));
} else if (CONTINUE == cond) { } else if (CONTINUE == cond) {
} else if (BREAK == cond) { } else if (BREAK == cond) {
swsResultDestroy(rt); swsResultDestroy(rt);
@ -528,7 +528,7 @@ static int32_t tfSearchCompareFunc_JSON(void* reader, SIndexTerm* tem, SIdxTRslt
} }
} }
if (MATCH == cond) { if (MATCH == cond) {
(void)tfileReaderLoadTableIds((TFileReader*)reader, rt->out.out, tr->total); TAOS_UNUSED(tfileReaderLoadTableIds((TFileReader*)reader, rt->out.out, tr->total));
} else if (CONTINUE == cond) { } else if (CONTINUE == cond) {
} else if (BREAK == cond) { } else if (BREAK == cond) {
swsResultDestroy(rt); swsResultDestroy(rt);
@ -639,7 +639,7 @@ int32_t tfileWriterPut(TFileWriter* tw, void* data, bool order) {
if (fn == NULL) { if (fn == NULL) {
return terrno; return terrno;
} }
(void)taosArraySortPWithExt((SArray*)(data), tfileValueCompare, &fn); TAOS_UNUSED(taosArraySortPWithExt((SArray*)(data), tfileValueCompare, &fn));
} }
int32_t sz = taosArrayGetSize((SArray*)data); int32_t sz = taosArrayGetSize((SArray*)data);
@ -654,7 +654,7 @@ int32_t tfileWriterPut(TFileWriter* tw, void* data, bool order) {
if (tbsz == 0) continue; if (tbsz == 0) continue;
fstOffset += TF_TABLE_TATOAL_SIZE(tbsz); fstOffset += TF_TABLE_TATOAL_SIZE(tbsz);
} }
(void)tfileWriteFstOffset(tw, fstOffset); TAOS_UNUSED(tfileWriteFstOffset(tw, fstOffset));
int32_t cap = 4 * 1024; int32_t cap = 4 * 1024;
char* buf = taosMemoryCalloc(1, cap); char* buf = taosMemoryCalloc(1, cap);
@ -682,7 +682,7 @@ int32_t tfileWriterPut(TFileWriter* tw, void* data, bool order) {
char* p = buf; char* p = buf;
tfileSerialTableIdsToBuf(p, v->tableId); tfileSerialTableIdsToBuf(p, v->tableId);
(void)(tw->ctx->write(tw->ctx, buf, ttsz)); TAOS_UNUSED((tw->ctx->write(tw->ctx, buf, ttsz)));
v->offset = tw->offset; v->offset = tw->offset;
tw->offset += ttsz; tw->offset += ttsz;
memset(buf, 0, cap); memset(buf, 0, cap);
@ -710,7 +710,7 @@ int32_t tfileWriterPut(TFileWriter* tw, void* data, bool order) {
} }
} }
fstBuilderDestroy(tw->fb); fstBuilderDestroy(tw->fb);
(void)tfileWriteFooter(tw); TAOS_UNUSED(tfileWriteFooter(tw));
return 0; return 0;
} }
void tfileWriterClose(TFileWriter* tw) { void tfileWriterClose(TFileWriter* tw) {
@ -739,7 +739,7 @@ IndexTFile* idxTFileCreate(SIndex* idx, const char* path) {
tfileCacheDestroy(cache); tfileCacheDestroy(cache);
return NULL; return NULL;
} }
(void)taosThreadMutexInit(&tfile->mtx, NULL); TAOS_UNUSED(taosThreadMutexInit(&tfile->mtx, NULL));
tfile->cache = cache; tfile->cache = cache;
return tfile; return tfile;
} }
@ -747,7 +747,7 @@ void idxTFileDestroy(IndexTFile* tfile) {
if (tfile == NULL) { if (tfile == NULL) {
return; return;
} }
(void)taosThreadMutexDestroy(&tfile->mtx); TAOS_UNUSED(taosThreadMutexDestroy(&tfile->mtx));
tfileCacheDestroy(tfile->cache); tfileCacheDestroy(tfile->cache);
taosMemoryFree(tfile); taosMemoryFree(tfile);
} }
@ -764,9 +764,9 @@ int idxTFileSearch(void* tfile, SIndexTermQuery* query, SIdxTRslt* result) {
SIndexTerm* term = query->term; SIndexTerm* term = query->term;
ICacheKey key = {.suid = term->suid, .colType = term->colType, .colName = term->colName, .nColName = term->nColName}; ICacheKey key = {.suid = term->suid, .colType = term->colType, .colName = term->colName, .nColName = term->nColName};
(void)taosThreadMutexLock(&pTfile->mtx); TAOS_UNUSED(taosThreadMutexLock(&pTfile->mtx));
TFileReader* reader = tfileCacheGet(pTfile->cache, &key); TFileReader* reader = tfileCacheGet(pTfile->cache, &key);
(void)taosThreadMutexUnlock(&pTfile->mtx); TAOS_UNUSED(taosThreadMutexUnlock(&pTfile->mtx));
if (reader == NULL) { if (reader == NULL) {
return 0; return 0;
} }
@ -870,9 +870,9 @@ TFileReader* tfileGetReaderByCol(IndexTFile* tf, uint64_t suid, char* colName) {
TFileReader* rd = NULL; TFileReader* rd = NULL;
ICacheKey key = {.suid = suid, .colType = TSDB_DATA_TYPE_BINARY, .colName = colName, .nColName = strlen(colName)}; ICacheKey key = {.suid = suid, .colType = TSDB_DATA_TYPE_BINARY, .colName = colName, .nColName = strlen(colName)};
(void)taosThreadMutexLock(&tf->mtx); TAOS_UNUSED(taosThreadMutexLock(&tf->mtx));
rd = tfileCacheGet(tf->cache, &key); rd = tfileCacheGet(tf->cache, &key);
(void)taosThreadMutexUnlock(&tf->mtx); TAOS_UNUSED(taosThreadMutexUnlock(&tf->mtx));
return rd; return rd;
} }
@ -978,7 +978,7 @@ static int tfileWriteData(TFileWriter* write, TFileValue* tval) {
static int tfileWriteFooter(TFileWriter* write) { static int tfileWriteFooter(TFileWriter* write) {
char buf[sizeof(FILE_MAGIC_NUMBER) + 1] = {0}; char buf[sizeof(FILE_MAGIC_NUMBER) + 1] = {0};
void* pBuf = (void*)buf; void* pBuf = (void*)buf;
(void)taosEncodeFixedU64((void**)(void*)&pBuf, FILE_MAGIC_NUMBER); TAOS_UNUSED(taosEncodeFixedU64((void**)(void*)&pBuf, FILE_MAGIC_NUMBER));
int nwrite = write->ctx->write(write->ctx, (uint8_t*)buf, (int32_t)strlen(buf)); int nwrite = write->ctx->write(write->ctx, (uint8_t*)buf, (int32_t)strlen(buf));
indexInfo("tfile write footer size: %d", write->ctx->size(write->ctx)); indexInfo("tfile write footer size: %d", write->ctx->size(write->ctx));
@ -1088,7 +1088,7 @@ static int tfileReaderVerify(TFileReader* reader) {
return TSDB_CODE_INDEX_INVALID_FILE; return TSDB_CODE_INDEX_INVALID_FILE;
} }
(void)taosDecodeFixedU64(buf, &tMagicNumber); TAOS_UNUSED(taosDecodeFixedU64(buf, &tMagicNumber));
return tMagicNumber == FILE_MAGIC_NUMBER ? 0 : TSDB_CODE_INDEX_INVALID_FILE; return tMagicNumber == FILE_MAGIC_NUMBER ? 0 : TSDB_CODE_INDEX_INVALID_FILE;
} }
@ -1143,15 +1143,15 @@ static int32_t tfileGetFileList(const char* path, SArray** ppResult) {
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _exception); TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _exception);
} }
} }
(void)taosCloseDir(&pDir); TAOS_UNUSED(taosCloseDir(&pDir));
taosArraySort(files, tfileCompare); taosArraySort(files, tfileCompare);
(void)tfileRmExpireFile(files); TAOS_UNUSED(tfileRmExpireFile(files));
*ppResult = files; *ppResult = files;
return 0; return 0;
_exception: _exception:
(void)taosCloseDir(&pDir); TAOS_UNUSED(taosCloseDir(&pDir));
if (files != NULL) { if (files != NULL) {
taosArrayDestroyEx(files, tfileDestroyFileName); taosArrayDestroyEx(files, tfileDestroyFileName);
taosArrayDestroy(files); taosArrayDestroy(files);
@ -1181,12 +1181,12 @@ static int tfileParseFileName(const char* filename, uint64_t* suid, char* col, i
} }
// tfile name suid-colId-version.tindex // tfile name suid-colId-version.tindex
static void tfileGenFileName(char* filename, uint64_t suid, const char* col, int64_t version) { static void tfileGenFileName(char* filename, uint64_t suid, const char* col, int64_t version) {
(void)sprintf(filename, "%" PRIu64 "-%s-%" PRId64 ".tindex", suid, col, version); TAOS_UNUSED(sprintf(filename, "%" PRIu64 "-%s-%" PRId64 ".tindex", suid, col, version));
return; return;
} }
static void FORCE_INLINE tfileGenFileFullName(char* fullname, const char* path, uint64_t suid, const char* col, static void FORCE_INLINE tfileGenFileFullName(char* fullname, const char* path, uint64_t suid, const char* col,
int64_t version) { int64_t version) {
char filename[128] = {0}; char filename[128] = {0};
tfileGenFileName(filename, suid, col, version); tfileGenFileName(filename, suid, col, version);
(void)sprintf(fullname, "%s/%s", path, filename); TAOS_UNUSED(sprintf(fullname, "%s/%s", path, filename));
} }

View File

@ -403,7 +403,7 @@ int32_t syncSendTimeoutRsp(int64_t rid, int64_t seq) {
TAOS_RETURN(code); TAOS_RETURN(code);
} }
SRpcMsg rpcMsg = {0}; SRpcMsg rpcMsg = {0, .info.notFreeAhandle = 1};
int32_t ret = syncRespMgrGetAndDel(pNode->pSyncRespMgr, seq, &rpcMsg.info); int32_t ret = syncRespMgrGetAndDel(pNode->pSyncRespMgr, seq, &rpcMsg.info);
rpcMsg.code = TSDB_CODE_SYN_TIMEOUT; rpcMsg.code = TSDB_CODE_SYN_TIMEOUT;

View File

@ -61,7 +61,7 @@ static void shellWorkAsClient() {
uint64_t startTime = taosGetTimestampUs(); uint64_t startTime = taosGetTimestampUs();
for (int32_t i = 0; i < pArgs->pktNum; ++i) { for (int32_t i = 0; i < pArgs->pktNum; ++i) {
SRpcMsg rpcMsg = {.info.ahandle = (void *)0x9525, .msgType = TDMT_DND_NET_TEST}; SRpcMsg rpcMsg = {.info.ahandle = (void *)0x9525, .info.notFreeAhandle = 1, .msgType = TDMT_DND_NET_TEST};
rpcMsg.pCont = rpcMallocCont(pArgs->pktLen); rpcMsg.pCont = rpcMallocCont(pArgs->pktLen);
rpcMsg.contLen = pArgs->pktLen; rpcMsg.contLen = pArgs->pktLen;