Merge pull request #13945 from taosdata/feature/TD-14481-3.0
fix: merge data in memory and file
This commit is contained in:
commit
e7e6d41211
|
@ -495,7 +495,9 @@ static int32_t tsdbCommitToFile(SCommitH *pCommith, SDFileSet *pSet, int fid) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pIter && pIter->pTable && (!pIdx || (pIter->pTable->suid <= pIdx->suid || pIter->pTable->uid <= pIdx->uid))) {
|
if (pIter && pIter->pTable &&
|
||||||
|
(!pIdx || ((pIter->pTable->suid < pIdx->suid) ||
|
||||||
|
((pIter->pTable->suid == pIdx->suid) && (pIter->pTable->uid <= pIdx->uid))))) {
|
||||||
if (tsdbCommitToTable(pCommith, mIter) < 0) {
|
if (tsdbCommitToTable(pCommith, mIter) < 0) {
|
||||||
tsdbCloseCommitFile(pCommith, true);
|
tsdbCloseCommitFile(pCommith, true);
|
||||||
// revert the file change
|
// revert the file change
|
||||||
|
@ -503,7 +505,7 @@ static int32_t tsdbCommitToFile(SCommitH *pCommith, SDFileSet *pSet, int fid) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pIdx && (pIter->pTable->uid == pIdx->uid)) {
|
if (pIdx && ((pIter->pTable->uid == pIdx->uid) && (pIter->pTable->suid == pIdx->suid))) {
|
||||||
++fIter;
|
++fIter;
|
||||||
}
|
}
|
||||||
++mIter;
|
++mIter;
|
||||||
|
@ -518,6 +520,8 @@ static int32_t tsdbCommitToFile(SCommitH *pCommith, SDFileSet *pSet, int fid) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
++fIter;
|
++fIter;
|
||||||
|
} else {
|
||||||
|
ASSERT(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue