refact: tsma/rsma code optimization
This commit is contained in:
parent
6f377e3234
commit
a2092892f7
|
@ -2246,17 +2246,17 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq2** ppReq, const SSDataBlock* pDat
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
SSubmitTbData pTbData = {0};
|
SSubmitTbData tbData = {0};
|
||||||
|
|
||||||
if (!(pTbData.aRowP = taosArrayInit(rows, sizeof(SRow*)))) {
|
if (!(tbData.aRowP = taosArrayInit(rows, sizeof(SRow*)))) {
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
pTbData.suid = suid;
|
tbData.suid = suid;
|
||||||
pTbData.uid = pDataBlock->info.id.groupId;
|
tbData.uid = pDataBlock->info.id.groupId;
|
||||||
pTbData.sver = pTSchema->version;
|
tbData.sver = pTSchema->version;
|
||||||
|
|
||||||
if (!pVals && !(pVals = taosArrayInit(colNum, sizeof(SColVal)))) {
|
if (!pVals && !(pVals = taosArrayInit(colNum, sizeof(SColVal)))) {
|
||||||
taosArrayDestroy(pTbData.aRowP);
|
taosArrayDestroy(tbData.aRowP);
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2354,14 +2354,14 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq2** ppReq, const SSDataBlock* pDat
|
||||||
}
|
}
|
||||||
SRow* pRow = NULL;
|
SRow* pRow = NULL;
|
||||||
if ((terrno = tRowBuild(pVals, pTSchema, &pRow)) < 0) {
|
if ((terrno = tRowBuild(pVals, pTSchema, &pRow)) < 0) {
|
||||||
tDestroySSubmitTbData(&pTbData, TSDB_MSG_FLG_ENCODE);
|
tDestroySSubmitTbData(&tbData, TSDB_MSG_FLG_ENCODE);
|
||||||
goto _end;
|
goto _end;
|
||||||
}
|
}
|
||||||
ASSERT(pRow);
|
ASSERT(pRow);
|
||||||
taosArrayPush(pTbData.aRowP, &pRow);
|
taosArrayPush(tbData.aRowP, &pRow);
|
||||||
}
|
}
|
||||||
|
|
||||||
taosArrayPush(pReq->aSubmitTbData, &pTbData);
|
taosArrayPush(pReq->aSubmitTbData, &tbData);
|
||||||
}
|
}
|
||||||
_end:
|
_end:
|
||||||
taosArrayDestroy(pVals);
|
taosArrayDestroy(pVals);
|
||||||
|
|
|
@ -714,6 +714,7 @@ static int32_t tdRSmaExecAndSubmitResult(SSma *pSma, qTaskInfo_t taskInfo, SRSma
|
||||||
|
|
||||||
if (pReq && tdProcessSubmitReq(sinkTsdb, output->info.version, pReq) < 0) {
|
if (pReq && tdProcessSubmitReq(sinkTsdb, output->info.version, pReq) < 0) {
|
||||||
tDestroySSubmitReq2(pReq, TSDB_MSG_FLG_ENCODE);
|
tDestroySSubmitReq2(pReq, TSDB_MSG_FLG_ENCODE);
|
||||||
|
taosMemoryFree(pReq);
|
||||||
smaError("vgId:%d, process submit req for rsma suid:%" PRIu64 ", uid:%" PRIu64 " level %" PRIi8
|
smaError("vgId:%d, process submit req for rsma suid:%" PRIu64 ", uid:%" PRIu64 " level %" PRIi8
|
||||||
" failed since %s",
|
" failed since %s",
|
||||||
SMA_VID(pSma), suid, output->info.id.groupId, pItem->level, terrstr());
|
SMA_VID(pSma), suid, output->info.id.groupId, pItem->level, terrstr());
|
||||||
|
@ -723,7 +724,10 @@ static int32_t tdRSmaExecAndSubmitResult(SSma *pSma, qTaskInfo_t taskInfo, SRSma
|
||||||
smaDebug("vgId:%d, process submit req for rsma suid:%" PRIu64 ",uid:%" PRIu64 ", level %" PRIi8 " ver %" PRIi64,
|
smaDebug("vgId:%d, process submit req for rsma suid:%" PRIu64 ",uid:%" PRIu64 ", level %" PRIi8 " ver %" PRIi64,
|
||||||
SMA_VID(pSma), suid, output->info.id.groupId, pItem->level, output->info.version);
|
SMA_VID(pSma), suid, output->info.id.groupId, pItem->level, output->info.version);
|
||||||
|
|
||||||
if (pReq) tDestroySSubmitReq2(pReq, TSDB_MSG_FLG_ENCODE);
|
if (pReq) {
|
||||||
|
tDestroySSubmitReq2(pReq, TSDB_MSG_FLG_ENCODE);
|
||||||
|
taosMemoryFree(pReq);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue