more code
This commit is contained in:
parent
eb2fb724b1
commit
2876f597f0
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue