fix: possible delete data loss when stt_trigger = 1
This commit is contained in:
parent
5ae13e7bf8
commit
5361d5f38a
|
@ -157,13 +157,8 @@ static int32_t tsdbCommitTombData(SCommitter2 *committer) {
|
|||
int64_t numRecord = 0;
|
||||
SMetaInfo info;
|
||||
|
||||
if (committer->tsdb->imem->nDel == 0) {
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
// do not need to write tomb data if there is no ts data
|
||||
bool skip = (committer->ctx->info->fset == NULL && !committer->ctx->hasTSData);
|
||||
|
||||
// if no history data and no new timestamp data, skip tomb data
|
||||
if (committer->ctx->info->fset || committer->ctx->hasTSData) {
|
||||
committer->ctx->tbid->suid = 0;
|
||||
committer->ctx->tbid->uid = 0;
|
||||
for (STombRecord *record; (record = tsdbIterMergerGetTombRecord(committer->tombIterMerger));) {
|
||||
|
@ -185,14 +180,13 @@ static int32_t tsdbCommitTombData(SCommitter2 *committer) {
|
|||
record->skey = TMAX(record->skey, committer->ctx->minKey);
|
||||
record->ekey = TMIN(record->ekey, committer->ctx->maxKey);
|
||||
|
||||
if (!skip) {
|
||||
numRecord++;
|
||||
TAOS_CHECK_GOTO(tsdbFSetWriteTombRecord(committer->writer, record), &lino, _exit);
|
||||
}
|
||||
}
|
||||
|
||||
TAOS_CHECK_GOTO(tsdbIterMergerNext(committer->tombIterMerger), &lino, _exit);
|
||||
}
|
||||
}
|
||||
|
||||
_exit:
|
||||
if (code) {
|
||||
|
|
Loading…
Reference in New Issue