fix: coverity issues
This commit is contained in:
parent
e9c213ff0f
commit
cff741e4c4
|
@ -343,13 +343,12 @@ static void vmCheckSyncTimeout(SVnodeMgmt *pMgmt) {
|
||||||
int32_t numOfVnodes = 0;
|
int32_t numOfVnodes = 0;
|
||||||
SVnodeObj **ppVnodes = vmGetVnodeListFromHash(pMgmt, &numOfVnodes);
|
SVnodeObj **ppVnodes = vmGetVnodeListFromHash(pMgmt, &numOfVnodes);
|
||||||
|
|
||||||
for (int32_t i = 0; i < numOfVnodes; ++i) {
|
|
||||||
SVnodeObj *pVnode = ppVnodes[i];
|
|
||||||
vnodeSyncCheckTimeout(pVnode->pImpl);
|
|
||||||
vmReleaseVnode(pMgmt, pVnode);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ppVnodes != NULL) {
|
if (ppVnodes != NULL) {
|
||||||
|
for (int32_t i = 0; i < numOfVnodes; ++i) {
|
||||||
|
SVnodeObj *pVnode = ppVnodes[i];
|
||||||
|
vnodeSyncCheckTimeout(pVnode->pImpl);
|
||||||
|
vmReleaseVnode(pMgmt, pVnode);
|
||||||
|
}
|
||||||
taosMemoryFree(ppVnodes);
|
taosMemoryFree(ppVnodes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,8 +201,8 @@ static SSdbRow *mndSmaActionDecode(SSdbRaw *pRaw) {
|
||||||
terrno = 0;
|
terrno = 0;
|
||||||
|
|
||||||
_OVER:
|
_OVER:
|
||||||
if (terrno != 0) {
|
if (terrno != 0 && pSma != NULL) {
|
||||||
mError("sma:%s, failed to decode from raw:%p since %s", pSma == NULL ? "null" : pSma->name, pRaw, terrstr());
|
mError("sma:%s, failed to decode from raw:%p since %s", pSma->name, pRaw, terrstr());
|
||||||
taosMemoryFreeClear(pSma->expr);
|
taosMemoryFreeClear(pSma->expr);
|
||||||
taosMemoryFreeClear(pSma->tagsFilter);
|
taosMemoryFreeClear(pSma->tagsFilter);
|
||||||
taosMemoryFreeClear(pSma->sql);
|
taosMemoryFreeClear(pSma->sql);
|
||||||
|
|
|
@ -271,9 +271,6 @@ SSyncFSM *mndSyncMakeFsm(SMnode *pMnode) {
|
||||||
int32_t mndInitSync(SMnode *pMnode) {
|
int32_t mndInitSync(SMnode *pMnode) {
|
||||||
SSyncMgmt *pMgmt = &pMnode->syncMgmt;
|
SSyncMgmt *pMgmt = &pMnode->syncMgmt;
|
||||||
taosThreadMutexInit(&pMgmt->lock, NULL);
|
taosThreadMutexInit(&pMgmt->lock, NULL);
|
||||||
pMgmt->transId = 0;
|
|
||||||
pMgmt->transSec = 0;
|
|
||||||
pMgmt->transSeq = 0;
|
|
||||||
|
|
||||||
SSyncInfo syncInfo = {
|
SSyncInfo syncInfo = {
|
||||||
.snapshotStrategy = SYNC_STRATEGY_STANDARD_SNAPSHOT,
|
.snapshotStrategy = SYNC_STRATEGY_STANDARD_SNAPSHOT,
|
||||||
|
|
|
@ -1441,10 +1441,10 @@ static int32_t mndRedistributeVgroup(SMnode *pMnode, SRpcMsg *pReq, SDbObj *pDb,
|
||||||
|
|
||||||
{
|
{
|
||||||
SSdbRaw *pRaw = mndVgroupActionEncode(&newVg);
|
SSdbRaw *pRaw = mndVgroupActionEncode(&newVg);
|
||||||
if (pRaw == NULL) return -1;
|
if (pRaw == NULL) goto _OVER;
|
||||||
if (mndTransAppendCommitlog(pTrans, pRaw) != 0) {
|
if (mndTransAppendCommitlog(pTrans, pRaw) != 0) {
|
||||||
sdbFreeRaw(pRaw);
|
sdbFreeRaw(pRaw);
|
||||||
return -1;
|
goto _OVER;
|
||||||
}
|
}
|
||||||
(void)sdbSetRawStatus(pRaw, SDB_STATUS_READY);
|
(void)sdbSetRawStatus(pRaw, SDB_STATUS_READY);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1703,8 +1703,7 @@ void syncNodeDoConfigChange(SSyncNode* pSyncNode, SSyncCfg* pNewConfig, SyncInde
|
||||||
|
|
||||||
_END:
|
_END:
|
||||||
// log end config change
|
// log end config change
|
||||||
sNInfo(pSyncNode, "end do config change, from %d to %d", pSyncNode->vgId, oldConfig.replicaNum,
|
sNInfo(pSyncNode, "end do config change, from %d to %d", oldConfig.replicaNum, pNewConfig->replicaNum);
|
||||||
pNewConfig->replicaNum);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// raft state change --------------
|
// raft state change --------------
|
||||||
|
|
|
@ -228,6 +228,7 @@ STaosQueue *tAutoQWorkerAllocQueue(SAutoQWorkerPool *pool, void *ahandle, FItem
|
||||||
taosMemoryFree(worker);
|
taosMemoryFree(worker);
|
||||||
taosCloseQueue(queue);
|
taosCloseQueue(queue);
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
taosThreadMutexUnlock(&pool->mutex);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
worker->id = curWorkerNum;
|
worker->id = curWorkerNum;
|
||||||
|
|
Loading…
Reference in New Issue