Merge pull request #22577 from taosdata/fix/TS-3865

fix: improve upgrade speed
This commit is contained in:
wade zhang 2023-08-25 18:02:02 +08:00 committed by GitHub
commit c7727800d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -120,7 +120,15 @@ static int32_t tsdbUpgradeHead(STsdb *tsdb, SDFileSet *pDFileSet, SDataFReader *
}; };
if (dataBlk->hasDup) { if (dataBlk->hasDup) {
code = tsdbReadDataBlockEx(reader, dataBlk, ctx->blockData); 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); TSDB_CHECK_CODE(code, lino, _exit);
record.count = 1; record.count = 1;
@ -334,6 +342,8 @@ static int32_t tsdbUpgradeFileSet(STsdb *tsdb, SDFileSet *pDFileSet, TFileSetArr
int32_t code = 0; int32_t code = 0;
int32_t lino = 0; int32_t lino = 0;
tsdbInfo("vgId:%d upgrade file set start, fid:%d", TD_VID(tsdb->pVnode), pDFileSet->fid);
SDataFReader *reader; SDataFReader *reader;
STFileSet *fset; STFileSet *fset;
@ -366,6 +376,8 @@ static int32_t tsdbUpgradeFileSet(STsdb *tsdb, SDFileSet *pDFileSet, TFileSetArr
code = TARRAY2_APPEND(fileSetArray, fset); code = TARRAY2_APPEND(fileSetArray, fset);
TSDB_CHECK_CODE(code, lino, _exit); TSDB_CHECK_CODE(code, lino, _exit);
tsdbInfo("vgId:%d upgrade file set end, fid:%d", TD_VID(tsdb->pVnode), pDFileSet->fid);
_exit: _exit:
if (code) { if (code) {
TSDB_ERROR_LOG(TD_VID(tsdb->pVnode), lino, code); TSDB_ERROR_LOG(TD_VID(tsdb->pVnode), lino, code);