fix/TD-31891-remove-void-mnode3-fix-case

This commit is contained in:
dmchen 2024-09-20 02:49:34 +00:00
parent e5fe2d33a4
commit c1fe2ec0ae
2 changed files with 26 additions and 11 deletions

View File

@ -1379,7 +1379,11 @@ static int32_t mndProcessGetDbCfgReq(SRpcMsg *pReq) {
goto _OVER;
}
if ((code = tSerializeSDbCfgRsp(pRsp, contLen, &cfgRsp)) < 0) goto _OVER;
int32_t ret = 0;
if ((ret = tSerializeSDbCfgRsp(pRsp, contLen, &cfgRsp)) < 0) {
code = ret;
goto _OVER;
}
pReq->info.rsp = pRsp;
pReq->info.rspLen = contLen;
@ -1578,7 +1582,8 @@ static int32_t mndBuildDropDbRsp(SDbObj *pDb, int32_t *pRspLen, void **ppRsp, bo
TAOS_RETURN(code);
}
if ((code = tSerializeSDropDbRsp(pRsp, rspLen, &dropRsp)) < 0) return code;
int32_t ret = 0;
if ((ret = tSerializeSDropDbRsp(pRsp, rspLen, &dropRsp)) < 0) return ret;
*pRspLen = rspLen;
*ppRsp = pRsp;
TAOS_RETURN(code);
@ -1822,14 +1827,18 @@ static int32_t mndProcessUseDbReq(SRpcMsg *pReq) {
goto _OVER;
}
if ((code = tSerializeSUseDbRsp(pRsp, contLen, &usedbRsp)) < 0) goto _OVER;
int32_t ret = 0;
if ((ret = tSerializeSUseDbRsp(pRsp, contLen, &usedbRsp)) < 0) {
code = ret;
goto _OVER;
}
pReq->info.rsp = pRsp;
pReq->info.rspLen = contLen;
_OVER:
if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) {
mError("db:%s, failed to process use db req since %s", usedbReq.db, terrstr());
mError("db:%s, failed to process use db req since %s", usedbReq.db, tstrerror(code));
}
mndReleaseDb(pMnode, pDb);
@ -1981,7 +1990,8 @@ int32_t mndValidateDbInfo(SMnode *pMnode, SDbCacheInfo *pDbs, int32_t numOfDbs,
tFreeSDbHbBatchRsp(&batchRsp);
return -1;
}
if ((code = tSerializeSDbHbBatchRsp(pRsp, rspLen, &batchRsp)) < 0) return code;
int32_t ret = 0;
if ((ret = tSerializeSDbHbBatchRsp(pRsp, rspLen, &batchRsp)) < 0) return ret;
*ppRsp = pRsp;
*pRspLen = rspLen;
@ -2011,9 +2021,10 @@ static int32_t mndTrimDb(SMnode *pMnode, SDbObj *pDb) {
}
pHead->contLen = htonl(contLen);
pHead->vgId = htonl(pVgroup->vgId);
if ((code = tSerializeSVTrimDbReq((char *)pHead + sizeof(SMsgHead), contLen, &trimReq)) < 0) {
int32_t ret = 0;
if ((ret = tSerializeSVTrimDbReq((char *)pHead + sizeof(SMsgHead), contLen, &trimReq)) < 0) {
sdbRelease(pSdb, pVgroup);
return code;
return ret;
}
SRpcMsg rpcMsg = {.msgType = TDMT_VND_TRIM, .pCont = pHead, .contLen = contLen};
@ -2083,9 +2094,10 @@ static int32_t mndS3MigrateDb(SMnode *pMnode, SDbObj *pDb) {
}
pHead->contLen = htonl(contLen);
pHead->vgId = htonl(pVgroup->vgId);
if ((code = tSerializeSVS3MigrateDbReq((char *)pHead + sizeof(SMsgHead), contLen, &s3migrateReq)) < 0) {
int32_t ret = 0;
if ((ret = tSerializeSVS3MigrateDbReq((char *)pHead + sizeof(SMsgHead), contLen, &s3migrateReq)) < 0) {
sdbRelease(pSdb, pVgroup);
return code;
return ret;
}
SRpcMsg rpcMsg = {.msgType = TDMT_VND_S3MIGRATE, .pCont = pHead, .contLen = contLen};

View File

@ -133,7 +133,6 @@ int mndSetCreateIdxRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SStb
}
static void *mndBuildDropIdxReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pStbObj, SIdxObj *pIdx, int32_t *contLen) {
int32_t len = 0;
int32_t ret = 0;
SDropIndexReq req = {0};
memcpy(req.colName, pIdx->colName, sizeof(pIdx->colName));
@ -159,7 +158,11 @@ static void *mndBuildDropIdxReq(SMnode *pMnode, SVgObj *pVgroup, SStbObj *pStbOb
pHead->vgId = htonl(pVgroup->vgId);
void *pBuf = POINTER_SHIFT(pHead, sizeof(SMsgHead));
if ((terrno = tSerializeSDropIdxReq(pBuf, len - sizeof(SMsgHead), &req)) != 0) return NULL;
int32_t ret = 0;
if ((ret = tSerializeSDropIdxReq(pBuf, len - sizeof(SMsgHead), &req)) < 0) {
terrno = ret;
return NULL;
}
*contLen = len;
return pHead;
_err: