提交 28e52065 编写于 作者: H Hongze Cheng

fix: commit bug

上级 1cfd3e74
......@@ -332,7 +332,10 @@ static int32_t tsdbCommitterUpdateTableSchema(SCommitter *pCommitter, int64_t su
int32_t code = 0;
if (suid) {
if (pCommitter->skmTable.suid == suid) goto _exit;
if (pCommitter->skmTable.suid == suid) {
pCommitter->skmTable.uid = uid;
goto _exit;
}
} else {
if (pCommitter->skmTable.uid == uid) goto _exit;
}
......@@ -425,8 +428,10 @@ static int32_t tsdbOpenCommitIter(SCommitter *pCommitter) {
tRBTreePut(&pCommitter->rbt, (SRBTreeNode *)pIter);
// disk
pCommitter->toLastOnly = 0;
SDataFReader *pReader = pCommitter->dReader.pReader;
if (pReader && pReader->pSet->nLastF >= pCommitter->maxLast) {
if (pReader) {
if (pReader->pSet->nLastF >= pCommitter->maxLast) {
int8_t iIter = 0;
for (int32_t iLast = 0; iLast < pReader->pSet->nLastF; iLast++) {
pIter = &pCommitter->aDataIter[iIter];
......@@ -451,14 +456,16 @@ static int32_t tsdbOpenCommitIter(SCommitter *pCommitter) {
tRBTreePut(&pCommitter->rbt, (SRBTreeNode *)pIter);
iIter++;
}
if (iIter > 0) {
pCommitter->toLastOnly = 0;
} else {
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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册