enh: refactor error code
This commit is contained in:
parent
3b6ce5d7dc
commit
f090c9f96e
|
@ -2228,7 +2228,7 @@ int32_t tDeserializeSGetUserAuthRspImpl(SDecoder *pDecoder, SGetUserAuthRsp *pRs
|
||||||
if ((value = taosMemoryCalloc(valuelen + 1, sizeof(char))) == NULL) goto _err;
|
if ((value = taosMemoryCalloc(valuelen + 1, sizeof(char))) == NULL) goto _err;
|
||||||
if (tDecodeCStrTo(pDecoder, value) < 0) goto _err;
|
if (tDecodeCStrTo(pDecoder, value) < 0) goto _err;
|
||||||
|
|
||||||
taosHashPut(pRsp->writeTbs, key, keyLen, value, valuelen + 1);
|
if (taosHashPut(pRsp->writeTbs, key, keyLen, value, valuelen + 1) < 0) goto _err;
|
||||||
|
|
||||||
taosMemoryFreeClear(key);
|
taosMemoryFreeClear(key);
|
||||||
taosMemoryFreeClear(value);
|
taosMemoryFreeClear(value);
|
||||||
|
@ -2285,7 +2285,7 @@ int32_t tDeserializeSGetUserAuthRspImpl(SDecoder *pDecoder, SGetUserAuthRsp *pRs
|
||||||
if ((value = taosMemoryCalloc(valuelen + 1, sizeof(char))) == NULL) goto _err;
|
if ((value = taosMemoryCalloc(valuelen + 1, sizeof(char))) == NULL) goto _err;
|
||||||
if (tDecodeCStrTo(pDecoder, value) < 0) goto _err;
|
if (tDecodeCStrTo(pDecoder, value) < 0) goto _err;
|
||||||
|
|
||||||
taosHashPut(pRsp->writeViews, key, keyLen, value, valuelen + 1);
|
if (taosHashPut(pRsp->writeViews, key, keyLen, value, valuelen + 1) < 0) goto _err;
|
||||||
|
|
||||||
taosMemoryFreeClear(key);
|
taosMemoryFreeClear(key);
|
||||||
taosMemoryFreeClear(value);
|
taosMemoryFreeClear(value);
|
||||||
|
@ -7101,7 +7101,7 @@ int32_t tDeserializeSMqSeekReq(void *buf, int32_t bufLen, SMqSeekReq *pReq) {
|
||||||
|
|
||||||
if (tStartDecode(&decoder) < 0) return -1;
|
if (tStartDecode(&decoder) < 0) return -1;
|
||||||
if (tDecodeI64(&decoder, &pReq->consumerId) < 0) return -1;
|
if (tDecodeI64(&decoder, &pReq->consumerId) < 0) return -1;
|
||||||
tDecodeCStrTo(&decoder, pReq->subKey);
|
if (tDecodeCStrTo(&decoder, pReq->subKey) < 0) return -1;
|
||||||
|
|
||||||
tEndDecode(&decoder);
|
tEndDecode(&decoder);
|
||||||
|
|
||||||
|
|
|
@ -276,13 +276,13 @@ void metaResumeTbCursor(SMTbCursor *pTbCur, int8_t first, int8_t move) {
|
||||||
(void)tdbTbcMoveToFirst((TBC *)pTbCur->pDbc);
|
(void)tdbTbcMoveToFirst((TBC *)pTbCur->pDbc);
|
||||||
} else {
|
} else {
|
||||||
int c = 1;
|
int c = 1;
|
||||||
tdbTbcMoveTo(pTbCur->pDbc, pTbCur->pKey, pTbCur->kLen, &c);
|
(void)tdbTbcMoveTo(pTbCur->pDbc, pTbCur->pKey, pTbCur->kLen, &c);
|
||||||
if (c == 0) {
|
if (c == 0) {
|
||||||
if (move) tdbTbcMoveToNext(pTbCur->pDbc);
|
if (move) tdbTbcMoveToNext(pTbCur->pDbc);
|
||||||
} else if (c < 0) {
|
} else if (c < 0) {
|
||||||
tdbTbcMoveToPrev(pTbCur->pDbc);
|
(void)tdbTbcMoveToPrev(pTbCur->pDbc);
|
||||||
} else {
|
} else {
|
||||||
tdbTbcMoveToNext(pTbCur->pDbc);
|
(void)tdbTbcMoveToNext(pTbCur->pDbc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ int32_t metaTbCursorNext(SMTbCursor *pTbCur, ETableType jumpTableType) {
|
||||||
|
|
||||||
tDecoderClear(&pTbCur->mr.coder);
|
tDecoderClear(&pTbCur->mr.coder);
|
||||||
|
|
||||||
metaGetTableEntryByVersion(&pTbCur->mr, ((SUidIdxVal *)pTbCur->pVal)[0].version, *(tb_uid_t *)pTbCur->pKey);
|
(void)metaGetTableEntryByVersion(&pTbCur->mr, ((SUidIdxVal *)pTbCur->pVal)[0].version, *(tb_uid_t *)pTbCur->pKey);
|
||||||
if (pTbCur->mr.me.type == jumpTableType) {
|
if (pTbCur->mr.me.type == jumpTableType) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -327,7 +327,7 @@ int32_t metaTbCursorPrev(SMTbCursor *pTbCur, ETableType jumpTableType) {
|
||||||
|
|
||||||
tDecoderClear(&pTbCur->mr.coder);
|
tDecoderClear(&pTbCur->mr.coder);
|
||||||
|
|
||||||
metaGetTableEntryByVersion(&pTbCur->mr, ((SUidIdxVal *)pTbCur->pVal)[0].version, *(tb_uid_t *)pTbCur->pKey);
|
(void)metaGetTableEntryByVersion(&pTbCur->mr, ((SUidIdxVal *)pTbCur->pVal)[0].version, *(tb_uid_t *)pTbCur->pKey);
|
||||||
if (pTbCur->mr.me.type == jumpTableType) {
|
if (pTbCur->mr.me.type == jumpTableType) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -355,11 +355,11 @@ _query:
|
||||||
|
|
||||||
version = ((SUidIdxVal *)pData)[0].version;
|
version = ((SUidIdxVal *)pData)[0].version;
|
||||||
|
|
||||||
tdbTbGet(pMeta->pTbDb, &(STbDbKey){.uid = uid, .version = version}, sizeof(STbDbKey), &pData, &nData);
|
(void)tdbTbGet(pMeta->pTbDb, &(STbDbKey){.uid = uid, .version = version}, sizeof(STbDbKey), &pData, &nData);
|
||||||
|
|
||||||
SMetaEntry me = {0};
|
SMetaEntry me = {0};
|
||||||
tDecoderInit(&dc, pData, nData);
|
tDecoderInit(&dc, pData, nData);
|
||||||
metaDecodeEntry(&dc, &me);
|
(void)metaDecodeEntry(&dc, &me);
|
||||||
if (me.type == TSDB_SUPER_TABLE) {
|
if (me.type == TSDB_SUPER_TABLE) {
|
||||||
if (sver == -1 || sver == me.stbEntry.schemaRow.version) {
|
if (sver == -1 || sver == me.stbEntry.schemaRow.version) {
|
||||||
pSchema = tCloneSSchemaWrapper(&me.stbEntry.schemaRow);
|
pSchema = tCloneSSchemaWrapper(&me.stbEntry.schemaRow);
|
||||||
|
@ -385,7 +385,7 @@ _query:
|
||||||
}
|
}
|
||||||
|
|
||||||
tDecoderInit(&dc, pData, nData);
|
tDecoderInit(&dc, pData, nData);
|
||||||
tDecodeSSchemaWrapperEx(&dc, &schema);
|
(void)tDecodeSSchemaWrapperEx(&dc, &schema);
|
||||||
pSchema = tCloneSSchemaWrapper(&schema);
|
pSchema = tCloneSSchemaWrapper(&schema);
|
||||||
tDecoderClear(&dc);
|
tDecoderClear(&dc);
|
||||||
|
|
||||||
|
@ -472,17 +472,17 @@ int32_t metaResumeCtbCursor(SMCtbCursor *pCtbCur, int8_t first) {
|
||||||
ctbIdxKey.suid = pCtbCur->suid;
|
ctbIdxKey.suid = pCtbCur->suid;
|
||||||
ctbIdxKey.uid = INT64_MIN;
|
ctbIdxKey.uid = INT64_MIN;
|
||||||
int c = 0;
|
int c = 0;
|
||||||
tdbTbcMoveTo(pCtbCur->pCur, &ctbIdxKey, sizeof(ctbIdxKey), &c);
|
(void)tdbTbcMoveTo(pCtbCur->pCur, &ctbIdxKey, sizeof(ctbIdxKey), &c);
|
||||||
if (c > 0) {
|
if (c > 0) {
|
||||||
tdbTbcMoveToNext(pCtbCur->pCur);
|
(void)tdbTbcMoveToNext(pCtbCur->pCur);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int c = 0;
|
int c = 0;
|
||||||
ret = tdbTbcMoveTo(pCtbCur->pCur, pCtbCur->pKey, pCtbCur->kLen, &c);
|
ret = tdbTbcMoveTo(pCtbCur->pCur, pCtbCur->pKey, pCtbCur->kLen, &c);
|
||||||
if (c < 0) {
|
if (c < 0) {
|
||||||
tdbTbcMoveToPrev(pCtbCur->pCur);
|
(void)tdbTbcMoveToPrev(pCtbCur->pCur);
|
||||||
} else {
|
} else {
|
||||||
tdbTbcMoveToNext(pCtbCur->pCur);
|
(void)tdbTbcMoveToNext(pCtbCur->pCur);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -540,9 +540,9 @@ SMStbCursor *metaOpenStbCursor(SMeta *pMeta, tb_uid_t suid) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// move to the suid
|
// move to the suid
|
||||||
tdbTbcMoveTo(pStbCur->pCur, &suid, sizeof(suid), &c);
|
(void)tdbTbcMoveTo(pStbCur->pCur, &suid, sizeof(suid), &c);
|
||||||
if (c > 0) {
|
if (c > 0) {
|
||||||
tdbTbcMoveToNext(pStbCur->pCur);
|
(void)tdbTbcMoveToNext(pStbCur->pCur);
|
||||||
}
|
}
|
||||||
|
|
||||||
return pStbCur;
|
return pStbCur;
|
||||||
|
@ -622,12 +622,12 @@ int32_t metaGetTbTSchemaEx(SMeta *pMeta, tb_uid_t suid, tb_uid_t uid, int32_t sv
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c < 0) {
|
if (c < 0) {
|
||||||
tdbTbcMoveToPrev(pSkmDbC);
|
(void)tdbTbcMoveToPrev(pSkmDbC);
|
||||||
}
|
}
|
||||||
|
|
||||||
const void *pKey = NULL;
|
const void *pKey = NULL;
|
||||||
int32_t nKey = 0;
|
int32_t nKey = 0;
|
||||||
tdbTbcGet(pSkmDbC, &pKey, &nKey, NULL, NULL);
|
(void)tdbTbcGet(pSkmDbC, &pKey, &nKey, NULL, NULL);
|
||||||
|
|
||||||
if (((SSkmDbKey *)pKey)->uid != skmDbKey.uid) {
|
if (((SSkmDbKey *)pKey)->uid != skmDbKey.uid) {
|
||||||
metaULock(pMeta);
|
metaULock(pMeta);
|
||||||
|
@ -753,9 +753,9 @@ SMSmaCursor *metaOpenSmaCursor(SMeta *pMeta, tb_uid_t uid) {
|
||||||
// move to the suid
|
// move to the suid
|
||||||
smaIdxKey.uid = uid;
|
smaIdxKey.uid = uid;
|
||||||
smaIdxKey.smaUid = INT64_MIN;
|
smaIdxKey.smaUid = INT64_MIN;
|
||||||
tdbTbcMoveTo(pSmaCur->pCur, &smaIdxKey, sizeof(smaIdxKey), &c);
|
(void)tdbTbcMoveTo(pSmaCur->pCur, &smaIdxKey, sizeof(smaIdxKey), &c);
|
||||||
if (c > 0) {
|
if (c > 0) {
|
||||||
tdbTbcMoveToNext(pSmaCur->pCur);
|
(void)tdbTbcMoveToNext(pSmaCur->pCur);
|
||||||
}
|
}
|
||||||
|
|
||||||
return pSmaCur;
|
return pSmaCur;
|
||||||
|
@ -863,7 +863,7 @@ STSmaWrapper *metaGetSmaInfoByTable(SMeta *pMeta, tb_uid_t uid, bool deepCopy) {
|
||||||
_err:
|
_err:
|
||||||
metaReaderClear(&mr);
|
metaReaderClear(&mr);
|
||||||
taosArrayDestroy(pSmaIds);
|
taosArrayDestroy(pSmaIds);
|
||||||
tFreeTSmaWrapper(pSW, deepCopy);
|
(void)tFreeTSmaWrapper(pSW, deepCopy);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1221,7 +1221,7 @@ int32_t metaFilterTableIds(void *pVnode, SMetaFltParam *arg, SArray *pUids) {
|
||||||
}
|
}
|
||||||
tbDbKey.uid = param->suid;
|
tbDbKey.uid = param->suid;
|
||||||
tbDbKey.version = ((SUidIdxVal *)pData)[0].version;
|
tbDbKey.version = ((SUidIdxVal *)pData)[0].version;
|
||||||
tdbTbGet(pMeta->pTbDb, &tbDbKey, sizeof(tbDbKey), &pData, &nData);
|
(void)tdbTbGet(pMeta->pTbDb, &tbDbKey, sizeof(tbDbKey), &pData, &nData);
|
||||||
|
|
||||||
tDecoderInit(&dc, pData, nData);
|
tDecoderInit(&dc, pData, nData);
|
||||||
ret = metaDecodeEntry(&dc, &oStbEntry);
|
ret = metaDecodeEntry(&dc, &oStbEntry);
|
||||||
|
@ -1427,7 +1427,7 @@ int32_t metaGetTableTags(void *pVnode, uint64_t suid, SArray *pUidTagInfo) {
|
||||||
taosHashInit(numOfElems / 0.7, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK);
|
taosHashInit(numOfElems / 0.7, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK);
|
||||||
for (int i = 0; i < numOfElems; i++) {
|
for (int i = 0; i < numOfElems; i++) {
|
||||||
STUidTagInfo *pTagInfo = taosArrayGet(pUidTagInfo, i);
|
STUidTagInfo *pTagInfo = taosArrayGet(pUidTagInfo, i);
|
||||||
taosHashPut(pSepecifiedUidMap, &pTagInfo->uid, sizeof(uint64_t), &i, sizeof(int32_t));
|
(void)taosHashPut(pSepecifiedUidMap, &pTagInfo->uid, sizeof(uint64_t), &i, sizeof(int32_t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1513,7 +1513,7 @@ int32_t metaGetInfo(SMeta *pMeta, int64_t uid, SMetaInfo *pInfo, SMetaReader *pR
|
||||||
}
|
}
|
||||||
// upsert the cache
|
// upsert the cache
|
||||||
metaWLock(pMeta);
|
metaWLock(pMeta);
|
||||||
metaCacheUpsert(pMeta, pInfo);
|
(void)metaCacheUpsert(pMeta, pInfo);
|
||||||
metaULock(pMeta);
|
metaULock(pMeta);
|
||||||
|
|
||||||
if (lock) {
|
if (lock) {
|
||||||
|
@ -1565,7 +1565,7 @@ int32_t metaGetStbStats(void *pVnode, int64_t uid, int64_t *numOfTables, int32_t
|
||||||
|
|
||||||
// upsert the cache
|
// upsert the cache
|
||||||
metaWLock(pVnodeObj->pMeta);
|
metaWLock(pVnodeObj->pMeta);
|
||||||
metaStatsCacheUpsert(pVnodeObj->pMeta, &state);
|
(void)metaStatsCacheUpsert(pVnodeObj->pMeta, &state);
|
||||||
metaULock(pVnodeObj->pMeta);
|
metaULock(pVnodeObj->pMeta);
|
||||||
|
|
||||||
_exit:
|
_exit:
|
||||||
|
@ -1578,6 +1578,6 @@ void metaUpdateStbStats(SMeta *pMeta, int64_t uid, int64_t deltaCtb, int32_t del
|
||||||
if (metaStatsCacheGet(pMeta, uid, &stats) == TSDB_CODE_SUCCESS) {
|
if (metaStatsCacheGet(pMeta, uid, &stats) == TSDB_CODE_SUCCESS) {
|
||||||
stats.ctbNum += deltaCtb;
|
stats.ctbNum += deltaCtb;
|
||||||
stats.colNum += deltaCol;
|
stats.colNum += deltaCol;
|
||||||
metaStatsCacheUpsert(pMeta, &stats);
|
(void)metaStatsCacheUpsert(pMeta, &stats);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -226,7 +226,7 @@ int metaDelJsonVarFromIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry, const SSche
|
||||||
(void)indexMultiTermAdd(terms, term);
|
(void)indexMultiTermAdd(terms, term);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
indexJsonPut(pMeta->pTagIvtIdx, terms, tuid);
|
(void)indexJsonPut(pMeta->pTagIvtIdx, terms, tuid);
|
||||||
indexMultiTermDestroy(terms);
|
indexMultiTermDestroy(terms);
|
||||||
taosArrayDestroy(pTagVals);
|
taosArrayDestroy(pTagVals);
|
||||||
#endif
|
#endif
|
||||||
|
@ -463,7 +463,7 @@ int metaAlterSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
|
||||||
oStbEntry.pBuf = taosMemoryMalloc(nData);
|
oStbEntry.pBuf = taosMemoryMalloc(nData);
|
||||||
memcpy(oStbEntry.pBuf, pData, nData);
|
memcpy(oStbEntry.pBuf, pData, nData);
|
||||||
tDecoderInit(&dc, oStbEntry.pBuf, nData);
|
tDecoderInit(&dc, oStbEntry.pBuf, nData);
|
||||||
metaDecodeEntry(&dc, &oStbEntry);
|
(void)metaDecodeEntry(&dc, &oStbEntry);
|
||||||
|
|
||||||
nStbEntry.version = version;
|
nStbEntry.version = version;
|
||||||
nStbEntry.type = TSDB_SUPER_TABLE;
|
nStbEntry.type = TSDB_SUPER_TABLE;
|
||||||
|
@ -487,7 +487,7 @@ int metaAlterSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
|
||||||
int8_t col_type = pReq->schemaRow.pSchema[nCols - 1].type;
|
int8_t col_type = pReq->schemaRow.pSchema[nCols - 1].type;
|
||||||
|
|
||||||
metaGetSubtables(pMeta, pReq->suid, uids);
|
metaGetSubtables(pMeta, pReq->suid, uids);
|
||||||
tsdbCacheNewSTableColumn(pTsdb, uids, cid, col_type);
|
(void)tsdbCacheNewSTableColumn(pTsdb, uids, cid, col_type);
|
||||||
} else if (deltaCol == -1) {
|
} else if (deltaCol == -1) {
|
||||||
int16_t cid = -1;
|
int16_t cid = -1;
|
||||||
bool hasPrimaryKey = false;
|
bool hasPrimaryKey = false;
|
||||||
|
@ -503,7 +503,7 @@ int metaAlterSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
|
||||||
|
|
||||||
if (cid != -1) {
|
if (cid != -1) {
|
||||||
metaGetSubtables(pMeta, pReq->suid, uids);
|
metaGetSubtables(pMeta, pReq->suid, uids);
|
||||||
tsdbCacheDropSTableColumn(pTsdb, uids, cid, hasPrimaryKey);
|
(void)tsdbCacheDropSTableColumn(pTsdb, uids, cid, hasPrimaryKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (uids) taosArrayDestroy(uids);
|
if (uids) taosArrayDestroy(uids);
|
||||||
|
@ -530,7 +530,7 @@ int metaAlterSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
|
||||||
|
|
||||||
if (updStat) {
|
if (updStat) {
|
||||||
int64_t ctbNum;
|
int64_t ctbNum;
|
||||||
metaGetStbStats(pMeta->pVnode, pReq->suid, &ctbNum, NULL);
|
(void)metaGetStbStats(pMeta->pVnode, pReq->suid, &ctbNum, NULL);
|
||||||
pMeta->pVnode->config.vndStats.numOfTimeSeries += (ctbNum * deltaCol);
|
pMeta->pVnode->config.vndStats.numOfTimeSeries += (ctbNum * deltaCol);
|
||||||
metaTimeSeriesNotifyCheck(pMeta);
|
metaTimeSeriesNotifyCheck(pMeta);
|
||||||
}
|
}
|
||||||
|
@ -568,7 +568,7 @@ int metaAddIndexToSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
|
||||||
|
|
||||||
tbDbKey.uid = suid;
|
tbDbKey.uid = suid;
|
||||||
tbDbKey.version = ((SUidIdxVal *)pData)[0].version;
|
tbDbKey.version = ((SUidIdxVal *)pData)[0].version;
|
||||||
tdbTbGet(pMeta->pTbDb, &tbDbKey, sizeof(tbDbKey), &pData, &nData);
|
(void)tdbTbGet(pMeta->pTbDb, &tbDbKey, sizeof(tbDbKey), &pData, &nData);
|
||||||
|
|
||||||
tDecoderInit(&dc, pData, nData);
|
tDecoderInit(&dc, pData, nData);
|
||||||
ret = metaDecodeEntry(&dc, &oStbEntry);
|
ret = metaDecodeEntry(&dc, &oStbEntry);
|
||||||
|
@ -672,7 +672,7 @@ int metaAddIndexToSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
|
||||||
}
|
}
|
||||||
|
|
||||||
metaWLock(pMeta);
|
metaWLock(pMeta);
|
||||||
tdbTbUpsert(pMeta->pTagIdx, pTagIdxKey, nTagIdxKey, NULL, 0, pMeta->txn);
|
(void)tdbTbUpsert(pMeta->pTagIdx, pTagIdxKey, nTagIdxKey, NULL, 0, pMeta->txn);
|
||||||
metaULock(pMeta);
|
metaULock(pMeta);
|
||||||
metaDestroyTagIdxKey(pTagIdxKey);
|
metaDestroyTagIdxKey(pTagIdxKey);
|
||||||
pTagIdxKey = NULL;
|
pTagIdxKey = NULL;
|
||||||
|
@ -729,7 +729,7 @@ int metaDropIndexFromSTable(SMeta *pMeta, int64_t version, SDropIndexReq *pReq)
|
||||||
|
|
||||||
tbDbKey.uid = suid;
|
tbDbKey.uid = suid;
|
||||||
tbDbKey.version = ((SUidIdxVal *)pData)[0].version;
|
tbDbKey.version = ((SUidIdxVal *)pData)[0].version;
|
||||||
tdbTbGet(pMeta->pTbDb, &tbDbKey, sizeof(tbDbKey), &pData, &nData);
|
(void)tdbTbGet(pMeta->pTbDb, &tbDbKey, sizeof(tbDbKey), &pData, &nData);
|
||||||
tDecoderInit(&dc, pData, nData);
|
tDecoderInit(&dc, pData, nData);
|
||||||
ret = metaDecodeEntry(&dc, &oStbEntry);
|
ret = metaDecodeEntry(&dc, &oStbEntry);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
@ -937,7 +937,7 @@ int metaCreateTable(SMeta *pMeta, int64_t ver, SVCreateTbReq *pReq, STableMetaRs
|
||||||
|
|
||||||
if (!sysTbl) {
|
if (!sysTbl) {
|
||||||
int32_t nCols = 0;
|
int32_t nCols = 0;
|
||||||
metaGetStbStats(pMeta->pVnode, me.ctbEntry.suid, 0, &nCols);
|
(void)metaGetStbStats(pMeta->pVnode, me.ctbEntry.suid, 0, &nCols);
|
||||||
pStats->numOfTimeSeries += nCols - 1;
|
pStats->numOfTimeSeries += nCols - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -948,7 +948,7 @@ int metaCreateTable(SMeta *pMeta, int64_t ver, SVCreateTbReq *pReq, STableMetaRs
|
||||||
metaULock(pMeta);
|
metaULock(pMeta);
|
||||||
|
|
||||||
if (!TSDB_CACHE_NO(pMeta->pVnode->config)) {
|
if (!TSDB_CACHE_NO(pMeta->pVnode->config)) {
|
||||||
tsdbCacheNewTable(pMeta->pVnode->pTsdb, me.uid, me.ctbEntry.suid, NULL);
|
(void)tsdbCacheNewTable(pMeta->pVnode->pTsdb, me.uid, me.ctbEntry.suid, NULL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
me.ntbEntry.btime = pReq->btime;
|
me.ntbEntry.btime = pReq->btime;
|
||||||
|
@ -964,7 +964,7 @@ int metaCreateTable(SMeta *pMeta, int64_t ver, SVCreateTbReq *pReq, STableMetaRs
|
||||||
pStats->numOfNTimeSeries += me.ntbEntry.schemaRow.nCols - 1;
|
pStats->numOfNTimeSeries += me.ntbEntry.schemaRow.nCols - 1;
|
||||||
|
|
||||||
if (!TSDB_CACHE_NO(pMeta->pVnode->config)) {
|
if (!TSDB_CACHE_NO(pMeta->pVnode->config)) {
|
||||||
tsdbCacheNewTable(pMeta->pVnode->pTsdb, me.uid, -1, &me.ntbEntry.schemaRow);
|
(void)tsdbCacheNewTable(pMeta->pVnode->pTsdb, me.uid, -1, &me.ntbEntry.schemaRow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1036,7 +1036,7 @@ int metaDropTable(SMeta *pMeta, int64_t version, SVDropTbReq *pReq, SArray *tbUi
|
||||||
(void)taosArrayPush(tbUids, &uid);
|
(void)taosArrayPush(tbUids, &uid);
|
||||||
|
|
||||||
if (!TSDB_CACHE_NO(pMeta->pVnode->config)) {
|
if (!TSDB_CACHE_NO(pMeta->pVnode->config)) {
|
||||||
tsdbCacheDropTable(pMeta->pVnode->pTsdb, uid, suid, NULL);
|
(void)tsdbCacheDropTable(pMeta->pVnode->pTsdb, uid, suid, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1070,7 +1070,7 @@ void metaDropTables(SMeta *pMeta, SArray *tbUids) {
|
||||||
} else {
|
} else {
|
||||||
nCtbDropped = 1;
|
nCtbDropped = 1;
|
||||||
}
|
}
|
||||||
tSimpleHashPut(suidHash, &suid, sizeof(tb_uid_t), &nCtbDropped, sizeof(int64_t));
|
(void)tSimpleHashPut(suidHash, &suid, sizeof(tb_uid_t), &nCtbDropped, sizeof(int64_t));
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
if (!TSDB_CACHE_NO(pMeta->pVnode->config)) {
|
if (!TSDB_CACHE_NO(pMeta->pVnode->config)) {
|
||||||
|
@ -1127,7 +1127,7 @@ static int32_t metaFilterTableByHash(SMeta *pMeta, SArray *uidList) {
|
||||||
SMetaEntry me = {0};
|
SMetaEntry me = {0};
|
||||||
SDecoder dc = {0};
|
SDecoder dc = {0};
|
||||||
tDecoderInit(&dc, pData, nData);
|
tDecoderInit(&dc, pData, nData);
|
||||||
metaDecodeEntry(&dc, &me);
|
(void)metaDecodeEntry(&dc, &me);
|
||||||
|
|
||||||
if (me.type != TSDB_SUPER_TABLE) {
|
if (me.type != TSDB_SUPER_TABLE) {
|
||||||
char tbFName[TSDB_TABLE_FNAME_LEN + 1];
|
char tbFName[TSDB_TABLE_FNAME_LEN + 1];
|
||||||
|
@ -1237,7 +1237,7 @@ static int metaDropTableByUid(SMeta *pMeta, tb_uid_t uid, int *type, tb_uid_t *p
|
||||||
}
|
}
|
||||||
int64_t version = ((SUidIdxVal *)pData)[0].version;
|
int64_t version = ((SUidIdxVal *)pData)[0].version;
|
||||||
|
|
||||||
tdbTbGet(pMeta->pTbDb, &(STbDbKey){.version = version, .uid = uid}, sizeof(STbDbKey), &pData, &nData);
|
(void)tdbTbGet(pMeta->pTbDb, &(STbDbKey){.version = version, .uid = uid}, sizeof(STbDbKey), &pData, &nData);
|
||||||
|
|
||||||
tDecoderInit(&dc, pData, nData);
|
tDecoderInit(&dc, pData, nData);
|
||||||
rc = metaDecodeEntry(&dc, &e);
|
rc = metaDecodeEntry(&dc, &e);
|
||||||
|
@ -1260,7 +1260,7 @@ static int metaDropTableByUid(SMeta *pMeta, tb_uid_t uid, int *type, tb_uid_t *p
|
||||||
SMetaEntry stbEntry = {0};
|
SMetaEntry stbEntry = {0};
|
||||||
|
|
||||||
tDecoderInit(&tdc, tData, tLen);
|
tDecoderInit(&tdc, tData, tLen);
|
||||||
metaDecodeEntry(&tdc, &stbEntry);
|
(void)metaDecodeEntry(&tdc, &stbEntry);
|
||||||
|
|
||||||
if (pSysTbl) *pSysTbl = metaTbInFilterCache(pMeta, stbEntry.name, 1) ? 1 : 0;
|
if (pSysTbl) *pSysTbl = metaTbInFilterCache(pMeta, stbEntry.name, 1) ? 1 : 0;
|
||||||
|
|
||||||
|
@ -1268,7 +1268,7 @@ static int metaDropTableByUid(SMeta *pMeta, tb_uid_t uid, int *type, tb_uid_t *p
|
||||||
SSchemaWrapper *pTagSchema = &stbEntry.stbEntry.schemaTag;
|
SSchemaWrapper *pTagSchema = &stbEntry.stbEntry.schemaTag;
|
||||||
if (pTagSchema->nCols == 1 && pTagSchema->pSchema[0].type == TSDB_DATA_TYPE_JSON) {
|
if (pTagSchema->nCols == 1 && pTagSchema->pSchema[0].type == TSDB_DATA_TYPE_JSON) {
|
||||||
pTagColumn = &stbEntry.stbEntry.schemaTag.pSchema[0];
|
pTagColumn = &stbEntry.stbEntry.schemaTag.pSchema[0];
|
||||||
metaDelJsonVarFromIdx(pMeta, &e, pTagColumn);
|
(void)metaDelJsonVarFromIdx(pMeta, &e, pTagColumn);
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < pTagSchema->nCols; i++) {
|
for (int i = 0; i < pTagSchema->nCols; i++) {
|
||||||
pTagColumn = &stbEntry.stbEntry.schemaTag.pSchema[i];
|
pTagColumn = &stbEntry.stbEntry.schemaTag.pSchema[i];
|
||||||
|
@ -1346,12 +1346,12 @@ static int metaDropTableByUid(SMeta *pMeta, tb_uid_t uid, int *type, tb_uid_t *p
|
||||||
// drop schema.db (todo)
|
// drop schema.db (todo)
|
||||||
|
|
||||||
(void)metaStatsCacheDrop(pMeta, uid);
|
(void)metaStatsCacheDrop(pMeta, uid);
|
||||||
metaUidCacheClear(pMeta, uid);
|
(void)metaUidCacheClear(pMeta, uid);
|
||||||
metaTbGroupCacheClear(pMeta, uid);
|
(void)metaTbGroupCacheClear(pMeta, uid);
|
||||||
--pMeta->pVnode->config.vndStats.numOfSTables;
|
--pMeta->pVnode->config.vndStats.numOfSTables;
|
||||||
}
|
}
|
||||||
|
|
||||||
metaCacheDrop(pMeta, uid);
|
(void)metaCacheDrop(pMeta, uid);
|
||||||
|
|
||||||
tDecoderClear(&dc);
|
tDecoderClear(&dc);
|
||||||
tdbFree(pData);
|
tdbFree(pData);
|
||||||
|
@ -1425,21 +1425,21 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
|
||||||
TBC *pUidIdxc = NULL;
|
TBC *pUidIdxc = NULL;
|
||||||
|
|
||||||
(void)tdbTbcOpen(pMeta->pUidIdx, &pUidIdxc, NULL);
|
(void)tdbTbcOpen(pMeta->pUidIdx, &pUidIdxc, NULL);
|
||||||
tdbTbcMoveTo(pUidIdxc, &uid, sizeof(uid), &c);
|
(void)tdbTbcMoveTo(pUidIdxc, &uid, sizeof(uid), &c);
|
||||||
if (c != 0) {
|
if (c != 0) {
|
||||||
(void)tdbTbcClose(pUidIdxc);
|
(void)tdbTbcClose(pUidIdxc);
|
||||||
metaError("meta/table: invalide c: %" PRId32 " alt tb column failed.", c);
|
metaError("meta/table: invalide c: %" PRId32 " alt tb column failed.", c);
|
||||||
return TSDB_CODE_FAILED;
|
return TSDB_CODE_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
tdbTbcGet(pUidIdxc, NULL, NULL, &pData, &nData);
|
(void)tdbTbcGet(pUidIdxc, NULL, NULL, &pData, &nData);
|
||||||
oversion = ((SUidIdxVal *)pData)[0].version;
|
oversion = ((SUidIdxVal *)pData)[0].version;
|
||||||
|
|
||||||
// search table.db
|
// search table.db
|
||||||
TBC *pTbDbc = NULL;
|
TBC *pTbDbc = NULL;
|
||||||
|
|
||||||
(void)tdbTbcOpen(pMeta->pTbDb, &pTbDbc, NULL);
|
(void)tdbTbcOpen(pMeta->pTbDb, &pTbDbc, NULL);
|
||||||
tdbTbcMoveTo(pTbDbc, &((STbDbKey){.uid = uid, .version = oversion}), sizeof(STbDbKey), &c);
|
(void)tdbTbcMoveTo(pTbDbc, &((STbDbKey){.uid = uid, .version = oversion}), sizeof(STbDbKey), &c);
|
||||||
if (c != 0) {
|
if (c != 0) {
|
||||||
(void)tdbTbcClose(pUidIdxc);
|
(void)tdbTbcClose(pUidIdxc);
|
||||||
(void)tdbTbcClose(pTbDbc);
|
(void)tdbTbcClose(pTbDbc);
|
||||||
|
@ -1447,7 +1447,7 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
|
||||||
return TSDB_CODE_FAILED;
|
return TSDB_CODE_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
tdbTbcGet(pTbDbc, NULL, NULL, &pData, &nData);
|
(void)tdbTbcGet(pTbDbc, NULL, NULL, &pData, &nData);
|
||||||
|
|
||||||
// get table entry
|
// get table entry
|
||||||
SDecoder dc = {0};
|
SDecoder dc = {0};
|
||||||
|
@ -1537,7 +1537,7 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
|
||||||
SSchema *pCol = &pSchema->pSchema[entry.ntbEntry.schemaRow.nCols - 1];
|
SSchema *pCol = &pSchema->pSchema[entry.ntbEntry.schemaRow.nCols - 1];
|
||||||
uint32_t compress = pAlterTbReq->action == TSDB_ALTER_TABLE_ADD_COLUMN ? createDefaultColCmprByType(pCol->type)
|
uint32_t compress = pAlterTbReq->action == TSDB_ALTER_TABLE_ADD_COLUMN ? createDefaultColCmprByType(pCol->type)
|
||||||
: pAlterTbReq->compress;
|
: pAlterTbReq->compress;
|
||||||
updataTableColCmpr(&entry.colCmpr, pCol, 1, compress);
|
(void)updataTableColCmpr(&entry.colCmpr, pCol, 1, compress);
|
||||||
freeColCmpr = true;
|
freeColCmpr = true;
|
||||||
ASSERT(entry.colCmpr.nCols == pSchema->nCols);
|
ASSERT(entry.colCmpr.nCols == pSchema->nCols);
|
||||||
break;
|
break;
|
||||||
|
@ -1575,7 +1575,7 @@ static int metaAlterTableColumn(SMeta *pMeta, int64_t version, SVAlterTbReq *pAl
|
||||||
(void)tsdbCacheDropNTableColumn(pMeta->pVnode->pTsdb, entry.uid, cid, hasPrimayKey);
|
(void)tsdbCacheDropNTableColumn(pMeta->pVnode->pTsdb, entry.uid, cid, hasPrimayKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
updataTableColCmpr(&entry.colCmpr, &tScheam, 0, 0);
|
(void)updataTableColCmpr(&entry.colCmpr, &tScheam, 0, 0);
|
||||||
ASSERT(entry.colCmpr.nCols == pSchema->nCols);
|
ASSERT(entry.colCmpr.nCols == pSchema->nCols);
|
||||||
break;
|
break;
|
||||||
case TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES:
|
case TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES:
|
||||||
|
@ -1690,14 +1690,14 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
|
||||||
TBC *pUidIdxc = NULL;
|
TBC *pUidIdxc = NULL;
|
||||||
|
|
||||||
(void)tdbTbcOpen(pMeta->pUidIdx, &pUidIdxc, NULL);
|
(void)tdbTbcOpen(pMeta->pUidIdx, &pUidIdxc, NULL);
|
||||||
tdbTbcMoveTo(pUidIdxc, &uid, sizeof(uid), &c);
|
(void)tdbTbcMoveTo(pUidIdxc, &uid, sizeof(uid), &c);
|
||||||
if (c != 0) {
|
if (c != 0) {
|
||||||
(void)tdbTbcClose(pUidIdxc);
|
(void)tdbTbcClose(pUidIdxc);
|
||||||
metaError("meta/table: invalide c: %" PRId32 " update tb tag val failed.", c);
|
metaError("meta/table: invalide c: %" PRId32 " update tb tag val failed.", c);
|
||||||
return terrno = TSDB_CODE_TDB_TABLE_NOT_EXIST;
|
return terrno = TSDB_CODE_TDB_TABLE_NOT_EXIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
tdbTbcGet(pUidIdxc, NULL, NULL, &pData, &nData);
|
(void)tdbTbcGet(pUidIdxc, NULL, NULL, &pData, &nData);
|
||||||
oversion = ((SUidIdxVal *)pData)[0].version;
|
oversion = ((SUidIdxVal *)pData)[0].version;
|
||||||
|
|
||||||
// search table.db
|
// search table.db
|
||||||
|
@ -1707,7 +1707,7 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
|
||||||
|
|
||||||
/* get ctbEntry */
|
/* get ctbEntry */
|
||||||
(void)tdbTbcOpen(pMeta->pTbDb, &pTbDbc, NULL);
|
(void)tdbTbcOpen(pMeta->pTbDb, &pTbDbc, NULL);
|
||||||
tdbTbcMoveTo(pTbDbc, &((STbDbKey){.uid = uid, .version = oversion}), sizeof(STbDbKey), &c);
|
(void)tdbTbcMoveTo(pTbDbc, &((STbDbKey){.uid = uid, .version = oversion}), sizeof(STbDbKey), &c);
|
||||||
if (c != 0) {
|
if (c != 0) {
|
||||||
(void)tdbTbcClose(pUidIdxc);
|
(void)tdbTbcClose(pUidIdxc);
|
||||||
(void)tdbTbcClose(pTbDbc);
|
(void)tdbTbcClose(pTbDbc);
|
||||||
|
@ -1715,25 +1715,25 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
|
||||||
return terrno = TSDB_CODE_TDB_TABLE_NOT_EXIST;
|
return terrno = TSDB_CODE_TDB_TABLE_NOT_EXIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
tdbTbcGet(pTbDbc, NULL, NULL, &pData, &nData);
|
(void)tdbTbcGet(pTbDbc, NULL, NULL, &pData, &nData);
|
||||||
|
|
||||||
ctbEntry.pBuf = taosMemoryMalloc(nData);
|
ctbEntry.pBuf = taosMemoryMalloc(nData);
|
||||||
memcpy(ctbEntry.pBuf, pData, nData);
|
memcpy(ctbEntry.pBuf, pData, nData);
|
||||||
tDecoderInit(&dc1, ctbEntry.pBuf, nData);
|
tDecoderInit(&dc1, ctbEntry.pBuf, nData);
|
||||||
metaDecodeEntry(&dc1, &ctbEntry);
|
(void)metaDecodeEntry(&dc1, &ctbEntry);
|
||||||
|
|
||||||
/* get stbEntry*/
|
/* get stbEntry*/
|
||||||
tdbTbGet(pMeta->pUidIdx, &ctbEntry.ctbEntry.suid, sizeof(tb_uid_t), &pVal, &nVal);
|
(void)tdbTbGet(pMeta->pUidIdx, &ctbEntry.ctbEntry.suid, sizeof(tb_uid_t), &pVal, &nVal);
|
||||||
if (!pVal) {
|
if (!pVal) {
|
||||||
terrno = TSDB_CODE_INVALID_MSG;
|
terrno = TSDB_CODE_INVALID_MSG;
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
|
|
||||||
tdbTbGet(pMeta->pTbDb, &((STbDbKey){.uid = ctbEntry.ctbEntry.suid, .version = ((SUidIdxVal *)pVal)[0].version}),
|
(void)tdbTbGet(pMeta->pTbDb, &((STbDbKey){.uid = ctbEntry.ctbEntry.suid, .version = ((SUidIdxVal *)pVal)[0].version}),
|
||||||
sizeof(STbDbKey), (void **)&stbEntry.pBuf, &nVal);
|
sizeof(STbDbKey), (void **)&stbEntry.pBuf, &nVal);
|
||||||
tdbFree(pVal);
|
tdbFree(pVal);
|
||||||
tDecoderInit(&dc2, stbEntry.pBuf, nVal);
|
tDecoderInit(&dc2, stbEntry.pBuf, nVal);
|
||||||
metaDecodeEntry(&dc2, &stbEntry);
|
(void)metaDecodeEntry(&dc2, &stbEntry);
|
||||||
|
|
||||||
SSchemaWrapper *pTagSchema = &stbEntry.stbEntry.schemaTag;
|
SSchemaWrapper *pTagSchema = &stbEntry.stbEntry.schemaTag;
|
||||||
SSchema *pColumn = NULL;
|
SSchema *pColumn = NULL;
|
||||||
|
@ -1816,8 +1816,8 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
|
||||||
}
|
}
|
||||||
|
|
||||||
SCtbIdxKey ctbIdxKey = {.suid = ctbEntry.ctbEntry.suid, .uid = uid};
|
SCtbIdxKey ctbIdxKey = {.suid = ctbEntry.ctbEntry.suid, .uid = uid};
|
||||||
tdbTbUpsert(pMeta->pCtbIdx, &ctbIdxKey, sizeof(ctbIdxKey), ctbEntry.ctbEntry.pTags,
|
(void)tdbTbUpsert(pMeta->pCtbIdx, &ctbIdxKey, sizeof(ctbIdxKey), ctbEntry.ctbEntry.pTags,
|
||||||
((STag *)(ctbEntry.ctbEntry.pTags))->len, pMeta->txn);
|
((STag *)(ctbEntry.ctbEntry.pTags))->len, pMeta->txn);
|
||||||
|
|
||||||
(void)metaUidCacheClear(pMeta, ctbEntry.ctbEntry.suid);
|
(void)metaUidCacheClear(pMeta, ctbEntry.ctbEntry.suid);
|
||||||
(void)metaTbGroupCacheClear(pMeta, ctbEntry.ctbEntry.suid);
|
(void)metaTbGroupCacheClear(pMeta, ctbEntry.ctbEntry.suid);
|
||||||
|
@ -1870,21 +1870,21 @@ static int metaUpdateTableOptions(SMeta *pMeta, int64_t version, SVAlterTbReq *p
|
||||||
TBC *pUidIdxc = NULL;
|
TBC *pUidIdxc = NULL;
|
||||||
|
|
||||||
(void)tdbTbcOpen(pMeta->pUidIdx, &pUidIdxc, NULL);
|
(void)tdbTbcOpen(pMeta->pUidIdx, &pUidIdxc, NULL);
|
||||||
tdbTbcMoveTo(pUidIdxc, &uid, sizeof(uid), &c);
|
(void)tdbTbcMoveTo(pUidIdxc, &uid, sizeof(uid), &c);
|
||||||
if (c != 0) {
|
if (c != 0) {
|
||||||
(void)tdbTbcClose(pUidIdxc);
|
(void)tdbTbcClose(pUidIdxc);
|
||||||
metaError("meta/table: invalide c: %" PRId32 " update tb options failed.", c);
|
metaError("meta/table: invalide c: %" PRId32 " update tb options failed.", c);
|
||||||
return TSDB_CODE_FAILED;
|
return TSDB_CODE_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
tdbTbcGet(pUidIdxc, NULL, NULL, &pData, &nData);
|
(void)tdbTbcGet(pUidIdxc, NULL, NULL, &pData, &nData);
|
||||||
oversion = ((SUidIdxVal *)pData)[0].version;
|
oversion = ((SUidIdxVal *)pData)[0].version;
|
||||||
|
|
||||||
// search table.db
|
// search table.db
|
||||||
TBC *pTbDbc = NULL;
|
TBC *pTbDbc = NULL;
|
||||||
|
|
||||||
(void)tdbTbcOpen(pMeta->pTbDb, &pTbDbc, NULL);
|
(void)tdbTbcOpen(pMeta->pTbDb, &pTbDbc, NULL);
|
||||||
tdbTbcMoveTo(pTbDbc, &((STbDbKey){.uid = uid, .version = oversion}), sizeof(STbDbKey), &c);
|
(void)tdbTbcMoveTo(pTbDbc, &((STbDbKey){.uid = uid, .version = oversion}), sizeof(STbDbKey), &c);
|
||||||
if (c != 0) {
|
if (c != 0) {
|
||||||
(void)tdbTbcClose(pUidIdxc);
|
(void)tdbTbcClose(pUidIdxc);
|
||||||
(void)tdbTbcClose(pTbDbc);
|
(void)tdbTbcClose(pTbDbc);
|
||||||
|
@ -1892,7 +1892,7 @@ static int metaUpdateTableOptions(SMeta *pMeta, int64_t version, SVAlterTbReq *p
|
||||||
return TSDB_CODE_FAILED;
|
return TSDB_CODE_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
tdbTbcGet(pTbDbc, NULL, NULL, &pData, &nData);
|
(void)tdbTbcGet(pTbDbc, NULL, NULL, &pData, &nData);
|
||||||
|
|
||||||
// get table entry
|
// get table entry
|
||||||
SDecoder dc = {0};
|
SDecoder dc = {0};
|
||||||
|
@ -1982,7 +1982,7 @@ static int metaAddTagIndex(SMeta *pMeta, int64_t version, SVAlterTbReq *pAlterTb
|
||||||
STbDbKey tbDbKey = {0};
|
STbDbKey tbDbKey = {0};
|
||||||
tbDbKey.uid = suid;
|
tbDbKey.uid = suid;
|
||||||
tbDbKey.version = ((SUidIdxVal *)pVal)[0].version;
|
tbDbKey.version = ((SUidIdxVal *)pVal)[0].version;
|
||||||
tdbTbGet(pMeta->pTbDb, &tbDbKey, sizeof(tbDbKey), &pVal, &nVal);
|
(void)tdbTbGet(pMeta->pTbDb, &tbDbKey, sizeof(tbDbKey), &pVal, &nVal);
|
||||||
tDecoderInit(&dc, pVal, nVal);
|
tDecoderInit(&dc, pVal, nVal);
|
||||||
ret = metaDecodeEntry(&dc, &stbEntry);
|
ret = metaDecodeEntry(&dc, &stbEntry);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
@ -2061,7 +2061,7 @@ static int metaAddTagIndex(SMeta *pMeta, int64_t version, SVAlterTbReq *pAlterTb
|
||||||
(void)tdbTbcClose(pCtbIdxc);
|
(void)tdbTbcClose(pCtbIdxc);
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
tdbTbUpsert(pMeta->pTagIdx, pTagIdxKey, nTagIdxKey, NULL, 0, pMeta->txn);
|
(void)tdbTbUpsert(pMeta->pTagIdx, pTagIdxKey, nTagIdxKey, NULL, 0, pMeta->txn);
|
||||||
metaDestroyTagIdxKey(pTagIdxKey);
|
metaDestroyTagIdxKey(pTagIdxKey);
|
||||||
pTagIdxKey = NULL;
|
pTagIdxKey = NULL;
|
||||||
}
|
}
|
||||||
|
@ -2116,7 +2116,7 @@ static int metaDropTagIndex(SMeta *pMeta, int64_t version, SVAlterTbReq *pAlterT
|
||||||
STbDbKey tbDbKey = {0};
|
STbDbKey tbDbKey = {0};
|
||||||
tbDbKey.uid = suid;
|
tbDbKey.uid = suid;
|
||||||
tbDbKey.version = ((SUidIdxVal *)pVal)[0].version;
|
tbDbKey.version = ((SUidIdxVal *)pVal)[0].version;
|
||||||
tdbTbGet(pMeta->pTbDb, &tbDbKey, sizeof(tbDbKey), &pVal, &nVal);
|
(void)tdbTbGet(pMeta->pTbDb, &tbDbKey, sizeof(tbDbKey), &pVal, &nVal);
|
||||||
|
|
||||||
tDecoderInit(&dc, pVal, nVal);
|
tDecoderInit(&dc, pVal, nVal);
|
||||||
ret = metaDecodeEntry(&dc, &stbEntry);
|
ret = metaDecodeEntry(&dc, &stbEntry);
|
||||||
|
@ -2363,7 +2363,7 @@ static int metaUpdateUidIdx(SMeta *pMeta, const SMetaEntry *pME) {
|
||||||
// upsert cache
|
// upsert cache
|
||||||
SMetaInfo info;
|
SMetaInfo info;
|
||||||
metaGetEntryInfo(pME, &info);
|
metaGetEntryInfo(pME, &info);
|
||||||
metaCacheUpsert(pMeta, &info);
|
(void)metaCacheUpsert(pMeta, &info);
|
||||||
|
|
||||||
SUidIdxVal uidIdxVal = {.suid = info.suid, .version = info.version, .skmVer = info.skmVer};
|
SUidIdxVal uidIdxVal = {.suid = info.suid, .version = info.version, .skmVer = info.skmVer};
|
||||||
|
|
||||||
|
@ -2479,7 +2479,7 @@ static int metaUpdateTagIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry) {
|
||||||
}
|
}
|
||||||
tbDbKey.uid = pCtbEntry->ctbEntry.suid;
|
tbDbKey.uid = pCtbEntry->ctbEntry.suid;
|
||||||
tbDbKey.version = ((SUidIdxVal *)pData)[0].version;
|
tbDbKey.version = ((SUidIdxVal *)pData)[0].version;
|
||||||
tdbTbGet(pMeta->pTbDb, &tbDbKey, sizeof(tbDbKey), &pData, &nData);
|
(void)tdbTbGet(pMeta->pTbDb, &tbDbKey, sizeof(tbDbKey), &pData, &nData);
|
||||||
|
|
||||||
tDecoderInit(&dc, pData, nData);
|
tDecoderInit(&dc, pData, nData);
|
||||||
ret = metaDecodeEntry(&dc, &stbEntry);
|
ret = metaDecodeEntry(&dc, &stbEntry);
|
||||||
|
@ -2526,7 +2526,7 @@ static int metaUpdateTagIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
tdbTbUpsert(pMeta->pTagIdx, pTagIdxKey, nTagIdxKey, NULL, 0, pMeta->txn);
|
(void)tdbTbUpsert(pMeta->pTagIdx, pTagIdxKey, nTagIdxKey, NULL, 0, pMeta->txn);
|
||||||
metaDestroyTagIdxKey(pTagIdxKey);
|
metaDestroyTagIdxKey(pTagIdxKey);
|
||||||
pTagIdxKey = NULL;
|
pTagIdxKey = NULL;
|
||||||
}
|
}
|
||||||
|
@ -2575,7 +2575,7 @@ static int metaSaveToSkmDb(SMeta *pMeta, const SMetaEntry *pME) {
|
||||||
}
|
}
|
||||||
|
|
||||||
tEncoderInit(&coder, pVal, vLen);
|
tEncoderInit(&coder, pVal, vLen);
|
||||||
tEncodeSSchemaWrapper(&coder, pSW);
|
(void)tEncodeSSchemaWrapper(&coder, pSW);
|
||||||
|
|
||||||
if (tdbTbInsert(pMeta->pSkmDb, &skmDbKey, sizeof(skmDbKey), pVal, vLen, pMeta->txn) < 0) {
|
if (tdbTbInsert(pMeta->pSkmDb, &skmDbKey, sizeof(skmDbKey), pVal, vLen, pMeta->txn) < 0) {
|
||||||
rcode = -1;
|
rcode = -1;
|
||||||
|
@ -2663,7 +2663,7 @@ int32_t colCompressDebug(SHashObj *pColCmprObj) {
|
||||||
p = taosHashIterate(pColCmprObj, p);
|
p = taosHashIterate(pColCmprObj, p);
|
||||||
|
|
||||||
uint8_t l1, l2, lvl;
|
uint8_t l1, l2, lvl;
|
||||||
tcompressDebug(cmprAlg, &l1, &l2, &lvl);
|
(void)tcompressDebug(cmprAlg, &l1, &l2, &lvl);
|
||||||
|
|
||||||
const char *l1str = columnEncodeStr(l1);
|
const char *l1str = columnEncodeStr(l1);
|
||||||
const char *l2str = columnCompressStr(l2);
|
const char *l2str = columnCompressStr(l2);
|
||||||
|
@ -2712,7 +2712,7 @@ int32_t metaGetColCmpr(SMeta *pMeta, tb_uid_t uid, SHashObj **ppColCmprObj) {
|
||||||
SColCmprWrapper *p = &e.colCmpr;
|
SColCmprWrapper *p = &e.colCmpr;
|
||||||
for (int32_t i = 0; i < p->nCols; i++) {
|
for (int32_t i = 0; i < p->nCols; i++) {
|
||||||
SColCmpr *pCmpr = &p->pColCmpr[i];
|
SColCmpr *pCmpr = &p->pColCmpr[i];
|
||||||
taosHashPut(pColCmprObj, &pCmpr->id, sizeof(pCmpr->id), &pCmpr->alg, sizeof(pCmpr->alg));
|
(void)taosHashPut(pColCmprObj, &pCmpr->id, sizeof(pCmpr->id), &pCmpr->alg, sizeof(pCmpr->alg));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tDecoderClear(&dc);
|
tDecoderClear(&dc);
|
||||||
|
@ -2726,7 +2726,7 @@ int32_t metaGetColCmpr(SMeta *pMeta, tb_uid_t uid, SHashObj **ppColCmprObj) {
|
||||||
metaULock(pMeta);
|
metaULock(pMeta);
|
||||||
|
|
||||||
*ppColCmprObj = pColCmprObj;
|
*ppColCmprObj = pColCmprObj;
|
||||||
colCompressDebug(pColCmprObj);
|
(void)colCompressDebug(pColCmprObj);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -388,7 +388,7 @@ SCacheObj *taosCacheInit(int32_t keyType, int64_t refreshTimeInMs, bool extendLi
|
||||||
}
|
}
|
||||||
|
|
||||||
pCacheObj->name = taosStrdup(cacheName);
|
pCacheObj->name = taosStrdup(cacheName);
|
||||||
doRegisterCacheObj(pCacheObj);
|
(void)doRegisterCacheObj(pCacheObj);
|
||||||
return pCacheObj;
|
return pCacheObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -616,7 +616,7 @@ void taosCacheRelease(SCacheObj *pCacheObj, void **data, bool _remove) {
|
||||||
if (ref > 0) {
|
if (ref > 0) {
|
||||||
taosAddToTrashcan(pCacheObj, pNode);
|
taosAddToTrashcan(pCacheObj, pNode);
|
||||||
} else { // ref == 0
|
} else { // ref == 0
|
||||||
atomic_sub_fetch_64(&pCacheObj->sizeInBytes, pNode->size);
|
(void)atomic_sub_fetch_64(&pCacheObj->sizeInBytes, pNode->size);
|
||||||
|
|
||||||
int32_t size = (int32_t)pCacheObj->numOfElems;
|
int32_t size = (int32_t)pCacheObj->numOfElems;
|
||||||
uDebug("cache:%s, key:%p, %p is destroyed from cache, size:%dbytes, totalNum:%d size:%" PRId64 "bytes",
|
uDebug("cache:%s, key:%p, %p is destroyed from cache, size:%dbytes, totalNum:%d size:%" PRId64 "bytes",
|
||||||
|
@ -670,7 +670,7 @@ void doTraverseElems(SCacheObj *pCacheObj, bool (*fp)(void *param, SCacheNode *p
|
||||||
pEntry->num -= 1;
|
pEntry->num -= 1;
|
||||||
ASSERT((pEntry->next && pEntry->num > 0) || (NULL == pEntry->next && pEntry->num == 0));
|
ASSERT((pEntry->next && pEntry->num > 0) || (NULL == pEntry->next && pEntry->num == 0));
|
||||||
|
|
||||||
atomic_sub_fetch_ptr(&pCacheObj->numOfElems, 1);
|
(void)atomic_sub_fetch_ptr(&pCacheObj->numOfElems, 1);
|
||||||
pNode = next;
|
pNode = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -399,7 +399,7 @@ int32_t taosHashGetDup(SHashObj *pHashObj, const void *key, size_t keyLen, void
|
||||||
int32_t taosHashGetDup_m(SHashObj *pHashObj, const void *key, size_t keyLen, void **destBuf, int32_t *size) {
|
int32_t taosHashGetDup_m(SHashObj *pHashObj, const void *key, size_t keyLen, void **destBuf, int32_t *size) {
|
||||||
terrno = 0;
|
terrno = 0;
|
||||||
|
|
||||||
/*char* p = */ taosHashGetImpl(pHashObj, key, keyLen, destBuf, size, false);
|
(void)taosHashGetImpl(pHashObj, key, keyLen, destBuf, size, false);
|
||||||
return terrno;
|
return terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -271,7 +271,7 @@ static void taosUnLockLogFile(TdFilePtr pFile) {
|
||||||
if (pFile == NULL) return;
|
if (pFile == NULL) return;
|
||||||
|
|
||||||
if (tsLogObj.fileNum > 1) {
|
if (tsLogObj.fileNum > 1) {
|
||||||
taosUnLockFile(pFile);
|
(void)taosUnLockFile(pFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -478,7 +478,7 @@ static int32_t taosOpenLogFile(char *fn, int32_t maxFileNum) {
|
||||||
|
|
||||||
char fileName[LOG_FILE_NAME_LEN + 50] = "\0";
|
char fileName[LOG_FILE_NAME_LEN + 50] = "\0";
|
||||||
sprintf(fileName, "%s.%d", tsLogObj.logName, tsLogObj.flag);
|
sprintf(fileName, "%s.%d", tsLogObj.logName, tsLogObj.flag);
|
||||||
taosThreadMutexInit(&tsLogObj.logMutex, NULL);
|
(void)taosThreadMutexInit(&tsLogObj.logMutex, NULL);
|
||||||
|
|
||||||
(void)taosUmaskFile(0);
|
(void)taosUmaskFile(0);
|
||||||
tsLogObj.logHandle->pFile = taosOpenFile(fileName, TD_FILE_CREATE | TD_FILE_WRITE);
|
tsLogObj.logHandle->pFile = taosOpenFile(fileName, TD_FILE_CREATE | TD_FILE_WRITE);
|
||||||
|
@ -562,7 +562,7 @@ static inline void taosPrintLogImp(ELogLevel level, int32_t dflag, const char *b
|
||||||
if (dflag & DEBUG_SCREEN) {
|
if (dflag & DEBUG_SCREEN) {
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wunused-result"
|
#pragma GCC diagnostic ignored "-Wunused-result"
|
||||||
write(1, buffer, (uint32_t)len);
|
(void)write(1, buffer, (uint32_t)len);
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -914,11 +914,11 @@ void taosLogCrashInfo(char *nodeType, char *pMsg, int64_t msgLen, int signum, vo
|
||||||
goto _return;
|
goto _return;
|
||||||
}
|
}
|
||||||
|
|
||||||
taosLockFile(pFile);
|
(void)taosLockFile(pFile);
|
||||||
|
|
||||||
int64_t writeSize = taosWriteFile(pFile, &msgLen, sizeof(msgLen));
|
int64_t writeSize = taosWriteFile(pFile, &msgLen, sizeof(msgLen));
|
||||||
if (sizeof(msgLen) != writeSize) {
|
if (sizeof(msgLen) != writeSize) {
|
||||||
taosUnLockFile(pFile);
|
(void)taosUnLockFile(pFile);
|
||||||
taosPrintLog(flags, level, dflag, "failed to write len to file:%s,%p wlen:%" PRId64 " tlen:%lu since %s",
|
taosPrintLog(flags, level, dflag, "failed to write len to file:%s,%p wlen:%" PRId64 " tlen:%lu since %s",
|
||||||
filepath, pFile, writeSize, sizeof(msgLen), terrstr());
|
filepath, pFile, writeSize, sizeof(msgLen), terrstr());
|
||||||
goto _return;
|
goto _return;
|
||||||
|
@ -926,7 +926,7 @@ void taosLogCrashInfo(char *nodeType, char *pMsg, int64_t msgLen, int signum, vo
|
||||||
|
|
||||||
writeSize = taosWriteFile(pFile, pMsg, msgLen);
|
writeSize = taosWriteFile(pFile, pMsg, msgLen);
|
||||||
if (msgLen != writeSize) {
|
if (msgLen != writeSize) {
|
||||||
taosUnLockFile(pFile);
|
(void)taosUnLockFile(pFile);
|
||||||
taosPrintLog(flags, level, dflag, "failed to write file:%s,%p wlen:%" PRId64 " tlen:%" PRId64 " since %s",
|
taosPrintLog(flags, level, dflag, "failed to write file:%s,%p wlen:%" PRId64 " tlen:%" PRId64 " since %s",
|
||||||
filepath, pFile, writeSize, msgLen, terrstr());
|
filepath, pFile, writeSize, msgLen, terrstr());
|
||||||
goto _return;
|
goto _return;
|
||||||
|
@ -990,7 +990,7 @@ void taosReadCrashInfo(char *filepath, char **pMsg, int64_t *pMsgLen, TdFilePtr
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
taosLockFile(pFile);
|
(void)taosLockFile(pFile);
|
||||||
} else {
|
} else {
|
||||||
pFile = *pFd;
|
pFile = *pFd;
|
||||||
}
|
}
|
||||||
|
@ -1031,7 +1031,7 @@ _return:
|
||||||
if (truncateFile) {
|
if (truncateFile) {
|
||||||
(void)taosFtruncateFile(pFile, 0);
|
(void)taosFtruncateFile(pFile, 0);
|
||||||
}
|
}
|
||||||
taosUnLockFile(pFile);
|
(void)taosUnLockFile(pFile);
|
||||||
(void)taosCloseFile(&pFile);
|
(void)taosCloseFile(&pFile);
|
||||||
taosMemoryFree(buf);
|
taosMemoryFree(buf);
|
||||||
|
|
||||||
|
@ -1045,7 +1045,7 @@ void taosReleaseCrashLogFile(TdFilePtr pFile, bool truncateFile) {
|
||||||
(void)taosFtruncateFile(pFile, 0);
|
(void)taosFtruncateFile(pFile, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
taosUnLockFile(pFile);
|
(void)taosUnLockFile(pFile);
|
||||||
(void)taosCloseFile(&pFile);
|
(void)taosCloseFile(&pFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -232,7 +232,7 @@ int32_t taosWriteQitem(STaosQueue *queue, void *pItem) {
|
||||||
(void)taosThreadMutexUnlock(&queue->mutex);
|
(void)taosThreadMutexUnlock(&queue->mutex);
|
||||||
|
|
||||||
if (queue->qset) {
|
if (queue->qset) {
|
||||||
tsem_post(&queue->qset->sem);
|
(void)tsem_post(&queue->qset->sem);
|
||||||
}
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,7 @@ void tSkipListDestroy(SSkipList *pSkipList) {
|
||||||
|
|
||||||
(void)tSkipListUnlock(pSkipList);
|
(void)tSkipListUnlock(pSkipList);
|
||||||
if (pSkipList->lock != NULL) {
|
if (pSkipList->lock != NULL) {
|
||||||
taosThreadRwlockDestroy(pSkipList->lock);
|
(void)taosThreadRwlockDestroy(pSkipList->lock);
|
||||||
taosMemoryFreeClear(pSkipList->lock);
|
taosMemoryFreeClear(pSkipList->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -713,7 +713,7 @@ static bool tQueryAutoQWorkerTryDecActive(void *p, int32_t minActive) {
|
||||||
if (atomicCompareExchangeActiveAndRunning(&pPool->activeRunningN, &active, active - 1, &running, running - 1))
|
if (atomicCompareExchangeActiveAndRunning(&pPool->activeRunningN, &active, active - 1, &running, running - 1))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
atomicFetchSubRunning(&pPool->activeRunningN, 1);
|
(void)atomicFetchSubRunning(&pPool->activeRunningN, 1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -732,7 +732,7 @@ static int32_t tQueryAutoQWorkerWaitingCheck(SQueryAutoQWorkerPool *pPool) {
|
||||||
}
|
}
|
||||||
// to wait for process
|
// to wait for process
|
||||||
(void)taosThreadMutexLock(&pPool->waitingBeforeProcessMsgLock);
|
(void)taosThreadMutexLock(&pPool->waitingBeforeProcessMsgLock);
|
||||||
atomic_fetch_add_32(&pPool->waitingBeforeProcessMsgN, 1);
|
(void)atomic_fetch_add_32(&pPool->waitingBeforeProcessMsgN, 1);
|
||||||
if (!pPool->exit) (void)taosThreadCondWait(&pPool->waitingBeforeProcessMsgCond, &pPool->waitingBeforeProcessMsgLock);
|
if (!pPool->exit) (void)taosThreadCondWait(&pPool->waitingBeforeProcessMsgCond, &pPool->waitingBeforeProcessMsgLock);
|
||||||
// recovered from waiting
|
// recovered from waiting
|
||||||
(void)taosThreadMutexUnlock(&pPool->waitingBeforeProcessMsgLock);
|
(void)taosThreadMutexUnlock(&pPool->waitingBeforeProcessMsgLock);
|
||||||
|
@ -744,7 +744,7 @@ bool tQueryAutoQWorkerTryRecycleWorker(SQueryAutoQWorkerPool *pPool, SQueryAutoQ
|
||||||
tQueryAutoQWorkerTryDecActive(pPool, pPool->num)) {
|
tQueryAutoQWorkerTryDecActive(pPool, pPool->num)) {
|
||||||
(void)taosThreadMutexLock(&pPool->poolLock);
|
(void)taosThreadMutexLock(&pPool->poolLock);
|
||||||
SListNode *pNode = listNode(pWorker);
|
SListNode *pNode = listNode(pWorker);
|
||||||
tdListPopNode(pPool->workers, pNode);
|
(void)tdListPopNode(pPool->workers, pNode);
|
||||||
// reclaim some workers
|
// reclaim some workers
|
||||||
if (pWorker->id >= pPool->maxInUse) {
|
if (pWorker->id >= pPool->maxInUse) {
|
||||||
while (listNEles(pPool->exitedWorkers) > pPool->maxInUse - pPool->num) {
|
while (listNEles(pPool->exitedWorkers) > pPool->maxInUse - pPool->num) {
|
||||||
|
@ -767,7 +767,7 @@ bool tQueryAutoQWorkerTryRecycleWorker(SQueryAutoQWorkerPool *pPool, SQueryAutoQ
|
||||||
|
|
||||||
// start to wait at backup cond
|
// start to wait at backup cond
|
||||||
(void)taosThreadMutexLock(&pPool->backupLock);
|
(void)taosThreadMutexLock(&pPool->backupLock);
|
||||||
atomic_fetch_add_32(&pPool->backupNum, 1);
|
(void)atomic_fetch_add_32(&pPool->backupNum, 1);
|
||||||
if (!pPool->exit) (void)taosThreadCondWait(&pPool->backupCond, &pPool->backupLock);
|
if (!pPool->exit) (void)taosThreadCondWait(&pPool->backupCond, &pPool->backupLock);
|
||||||
(void)taosThreadMutexUnlock(&pPool->backupLock);
|
(void)taosThreadMutexUnlock(&pPool->backupLock);
|
||||||
|
|
||||||
|
@ -777,7 +777,7 @@ bool tQueryAutoQWorkerTryRecycleWorker(SQueryAutoQWorkerPool *pPool, SQueryAutoQ
|
||||||
(void)taosThreadMutexUnlock(&pPool->poolLock);
|
(void)taosThreadMutexUnlock(&pPool->poolLock);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
tdListPopNode(pPool->backupWorkers, pNode);
|
(void)tdListPopNode(pPool->backupWorkers, pNode);
|
||||||
tdListAppendNode(pPool->workers, pNode);
|
tdListAppendNode(pPool->workers, pNode);
|
||||||
(void)taosThreadMutexUnlock(&pPool->poolLock);
|
(void)taosThreadMutexUnlock(&pPool->poolLock);
|
||||||
|
|
||||||
|
@ -881,9 +881,9 @@ void tQueryAutoQWorkerCleanup(SQueryAutoQWorkerPool *pPool) {
|
||||||
taosMemoryFree(pNode);
|
taosMemoryFree(pNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
tdListFree(pPool->workers);
|
(void)tdListFree(pPool->workers);
|
||||||
tdListFree(pPool->backupWorkers);
|
(void)tdListFree(pPool->backupWorkers);
|
||||||
tdListFree(pPool->exitedWorkers);
|
(void)tdListFree(pPool->exitedWorkers);
|
||||||
taosMemoryFree(pPool->pCb);
|
taosMemoryFree(pPool->pCb);
|
||||||
|
|
||||||
(void)taosThreadMutexDestroy(&pPool->poolLock);
|
(void)taosThreadMutexDestroy(&pPool->poolLock);
|
||||||
|
@ -939,7 +939,7 @@ STaosQueue *tQueryAutoQWorkerAllocQueue(SQueryAutoQWorkerPool *pool, void *ahand
|
||||||
|
|
||||||
(void)taosThreadAttrDestroy(&thAttr);
|
(void)taosThreadAttrDestroy(&thAttr);
|
||||||
pool->num++;
|
pool->num++;
|
||||||
atomicFetchAddActive(&pool->activeRunningN, 1);
|
(void)atomicFetchAddActive(&pool->activeRunningN, 1);
|
||||||
uInfo("worker:%s:%d is launched, total:%d", pool->name, pWorker->id, pool->num);
|
uInfo("worker:%s:%d is launched, total:%d", pool->name, pWorker->id, pool->num);
|
||||||
} while (pool->num < pool->min);
|
} while (pool->num < pool->min);
|
||||||
}
|
}
|
||||||
|
@ -1016,7 +1016,7 @@ static int32_t tQueryAutoQWorkerRecoverFromBlocking(void *p) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(void)taosThreadMutexLock(&pPool->waitingAfterBlockLock);
|
(void)taosThreadMutexLock(&pPool->waitingAfterBlockLock);
|
||||||
atomic_fetch_add_32(&pPool->waitingAfterBlockN, 1);
|
(void)atomic_fetch_add_32(&pPool->waitingAfterBlockN, 1);
|
||||||
if (!pPool->exit) (void)taosThreadCondWait(&pPool->waitingAfterBlockCond, &pPool->waitingAfterBlockLock);
|
if (!pPool->exit) (void)taosThreadCondWait(&pPool->waitingAfterBlockCond, &pPool->waitingAfterBlockLock);
|
||||||
(void)taosThreadMutexUnlock(&pPool->waitingAfterBlockLock);
|
(void)taosThreadMutexUnlock(&pPool->waitingAfterBlockLock);
|
||||||
if (pPool->exit) return TSDB_CODE_QRY_QWORKER_QUIT;
|
if (pPool->exit) return TSDB_CODE_QRY_QWORKER_QUIT;
|
||||||
|
|
Loading…
Reference in New Issue