提交 2876f597 编写于 作者: H Hongze Cheng

more code

上级 eb2fb724
......@@ -405,10 +405,6 @@ static int32_t tsdbCommitFileDataStart(SCommitter *pCommitter) {
}
wSet.nLastF = pRSet->nLastF + 1;
wSet.aLastF[wSet.nLastF - 1] = &fLast; // todo
if (wSet.nLastF == pCommitter->maxLast) {
pCommitter->toMerge = 1;
}
} else {
fHead = (SHeadFile){.commitID = pCommitter->commitID};
fData = (SDataFile){.commitID = pCommitter->commitID};
......@@ -427,6 +423,9 @@ static int32_t tsdbCommitFileDataStart(SCommitter *pCommitter) {
wSet.nLastF = 1;
wSet.aLastF[0] = &fLast;
}
if (wSet.nLastF == pCommitter->maxLast) {
pCommitter->toMerge = 1;
}
code = tsdbDataFWriterOpen(&pCommitter->dWriter.pWriter, pTsdb, &wSet);
if (code) goto _err;
......
......@@ -261,11 +261,13 @@ static int32_t tsdbMergeFileData(STsdbMerger *pMerger, SDFileSet *pSet) {
// impl
SRowInfo rInfo = {.suid = INT64_MIN};
SRowInfo *pInfo;
int64_t nRow = 0;
while (true) {
code = tDataMergeNext(&pMerger->dReader.merger, &pInfo);
if (code) goto _err;
if (pInfo == NULL) break;
nRow++;
ASSERT(tRowInfoCmprFn(pInfo, &rInfo) > 0);
rInfo = *pInfo;
......
......@@ -925,11 +925,11 @@ int32_t tsdbReadLastBlockEx(SDataFReader *pReader, int32_t iLast, SBlockL *pBloc
int32_t code = 0;
// read
code = tsdbReadAndCheck(pReader->aLastFD[iLast], pBlockL->bInfo.offset, &pReader->aBuf[1], pBlockL->bInfo.szBlock, 0);
code = tsdbReadAndCheck(pReader->aLastFD[iLast], pBlockL->bInfo.offset, &pReader->aBuf[0], pBlockL->bInfo.szBlock, 0);
if (code) goto _exit;
// decmpr
code = tDecmprBlockData(pReader->aBuf[1], pBlockL->bInfo.szBlock, pBlockData, &pReader->aBuf[1]);
code = tDecmprBlockData(pReader->aBuf[0], pBlockL->bInfo.szBlock, pBlockData, &pReader->aBuf[1]);
if (code) goto _exit;
_exit:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册