Skip to content

Commit

Permalink
Merge pull request #22685 from taosdata/fix/TS-3865
Browse files Browse the repository at this point in the history
enh: upgrade more efficiently
  • Loading branch information
gccgdb1234 committed Sep 1, 2023
2 parents 6a24e2c + 1138670 commit c2c96c4
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions source/dnode/vnode/src/tsdb/tsdbUpgrade.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,7 @@ static int32_t tsdbUpgradeHead(STsdb *tsdb, SDFileSet *pDFileSet, SDataFReader *
};

if (dataBlk->hasDup) {
tBlockDataReset(ctx->blockData);

int16_t aCid = 0;
STSchema tSchema = {0};
TABLEID tbid = {.suid = pBlockIdx->suid, .uid = pBlockIdx->uid};
code = tBlockDataInit(ctx->blockData, &tbid, &tSchema, &aCid, 0);
TSDB_CHECK_CODE(code, lino, _exit);

code = tsdbReadDataBlock(reader, dataBlk, ctx->blockData);
TSDB_CHECK_CODE(code, lino, _exit);

record.count = 1;
for (int32_t i = 1; i < ctx->blockData->nRow; ++i) {
if (ctx->blockData->aTSKEY[i] != ctx->blockData->aTSKEY[i - 1]) {
record.count++;
}
}
record.count = 0;
}

code = tBrinBlockPut(ctx->brinBlock, &record);
Expand Down

0 comments on commit c2c96c4

Please sign in to comment.