fix: commit bug
This commit is contained in:
parent
1cfd3e74f9
commit
28e520656b
|
@ -332,7 +332,10 @@ static int32_t tsdbCommitterUpdateTableSchema(SCommitter *pCommitter, int64_t su
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
|
|
||||||
if (suid) {
|
if (suid) {
|
||||||
if (pCommitter->skmTable.suid == suid) goto _exit;
|
if (pCommitter->skmTable.suid == suid) {
|
||||||
|
pCommitter->skmTable.uid = uid;
|
||||||
|
goto _exit;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (pCommitter->skmTable.uid == uid) goto _exit;
|
if (pCommitter->skmTable.uid == uid) goto _exit;
|
||||||
}
|
}
|
||||||
|
@ -425,40 +428,44 @@ static int32_t tsdbOpenCommitIter(SCommitter *pCommitter) {
|
||||||
tRBTreePut(&pCommitter->rbt, (SRBTreeNode *)pIter);
|
tRBTreePut(&pCommitter->rbt, (SRBTreeNode *)pIter);
|
||||||
|
|
||||||
// disk
|
// disk
|
||||||
|
pCommitter->toLastOnly = 0;
|
||||||
SDataFReader *pReader = pCommitter->dReader.pReader;
|
SDataFReader *pReader = pCommitter->dReader.pReader;
|
||||||
if (pReader && pReader->pSet->nLastF >= pCommitter->maxLast) {
|
if (pReader) {
|
||||||
int8_t iIter = 0;
|
if (pReader->pSet->nLastF >= pCommitter->maxLast) {
|
||||||
for (int32_t iLast = 0; iLast < pReader->pSet->nLastF; iLast++) {
|
int8_t iIter = 0;
|
||||||
pIter = &pCommitter->aDataIter[iIter];
|
for (int32_t iLast = 0; iLast < pReader->pSet->nLastF; iLast++) {
|
||||||
pIter->type = LAST_DATA_ITER;
|
pIter = &pCommitter->aDataIter[iIter];
|
||||||
pIter->iLast = iLast;
|
pIter->type = LAST_DATA_ITER;
|
||||||
|
pIter->iLast = iLast;
|
||||||
|
|
||||||
code = tsdbReadBlockL(pCommitter->dReader.pReader, iLast, pIter->aBlockL);
|
code = tsdbReadBlockL(pCommitter->dReader.pReader, iLast, pIter->aBlockL);
|
||||||
if (code) goto _err;
|
if (code) goto _err;
|
||||||
|
|
||||||
if (taosArrayGetSize(pIter->aBlockL) == 0) continue;
|
if (taosArrayGetSize(pIter->aBlockL) == 0) continue;
|
||||||
|
|
||||||
pIter->iBlockL = 0;
|
pIter->iBlockL = 0;
|
||||||
SBlockL *pBlockL = (SBlockL *)taosArrayGet(pIter->aBlockL, 0);
|
SBlockL *pBlockL = (SBlockL *)taosArrayGet(pIter->aBlockL, 0);
|
||||||
code = tsdbReadLastBlockEx(pCommitter->dReader.pReader, iLast, pBlockL, &pIter->bData);
|
code = tsdbReadLastBlockEx(pCommitter->dReader.pReader, iLast, pBlockL, &pIter->bData);
|
||||||
if (code) goto _err;
|
if (code) goto _err;
|
||||||
|
|
||||||
pIter->iRow = 0;
|
pIter->iRow = 0;
|
||||||
pIter->r.suid = pIter->bData.suid;
|
pIter->r.suid = pIter->bData.suid;
|
||||||
pIter->r.uid = pIter->bData.uid ? pIter->bData.uid : pIter->bData.aUid[0];
|
pIter->r.uid = pIter->bData.uid ? pIter->bData.uid : pIter->bData.aUid[0];
|
||||||
pIter->r.row = tsdbRowFromBlockData(&pIter->bData, 0);
|
pIter->r.row = tsdbRowFromBlockData(&pIter->bData, 0);
|
||||||
|
|
||||||
tRBTreePut(&pCommitter->rbt, (SRBTreeNode *)pIter);
|
tRBTreePut(&pCommitter->rbt, (SRBTreeNode *)pIter);
|
||||||
iIter++;
|
iIter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iIter > 0) {
|
|
||||||
pCommitter->toLastOnly = 0;
|
|
||||||
} else {
|
} else {
|
||||||
pCommitter->toLastOnly = 1;
|
pCommitter->toLastOnly = 0;
|
||||||
|
for (int32_t iLast = 0; iLast < pReader->pSet->nLastF; iLast++) {
|
||||||
|
SLastFile *pLastFile = pReader->pSet->aLastF[iLast];
|
||||||
|
if (pLastFile->size > pLastFile->offset) {
|
||||||
|
pCommitter->toLastOnly = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
pCommitter->toLastOnly = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
code = tsdbNextCommitRow(pCommitter);
|
code = tsdbNextCommitRow(pCommitter);
|
||||||
|
|
Loading…
Reference in New Issue