From 5904f967f5db69596032dad989cb20af9c45b257 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Mon, 30 Jan 2023 15:38:19 +0800 Subject: [PATCH] fix: snapshot problem --- source/dnode/vnode/src/meta/metaQuery.c | 5 ++--- source/dnode/vnode/src/tsdb/tsdbSnapshot.c | 2 ++ source/dnode/vnode/src/tsdb/tsdbUtil.c | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/dnode/vnode/src/meta/metaQuery.c b/source/dnode/vnode/src/meta/metaQuery.c index fc41d507a8..f3fa3772b4 100644 --- a/source/dnode/vnode/src/meta/metaQuery.c +++ b/source/dnode/vnode/src/meta/metaQuery.c @@ -706,9 +706,8 @@ int32_t metaGetTbTSchemaEx(SMeta *pMeta, tb_uid_t suid, tb_uid_t uid, int32_t sv } } - if (sver <= 0) { - metaError("meta/query: incorrect sver: %" PRId32 ".", sver); - code = TSDB_CODE_FAILED; + if (taosAssertDebug(sver > 0, __FILE__, __LINE__, "failed to get table schema version: %d", sver) < 0) { + code = TSDB_CODE_NOT_FOUND; goto _exit; } diff --git a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c index e431862cdd..c280e8c0e7 100644 --- a/source/dnode/vnode/src/tsdb/tsdbSnapshot.c +++ b/source/dnode/vnode/src/tsdb/tsdbSnapshot.c @@ -732,6 +732,8 @@ static int32_t tsdbSnapReadTimeSeriesData(STsdbSnapReader* pReader, uint8_t** pp } if (pReader->bData.nRow > 0) { + ASSERT(pReader->bData.suid || pReader->bData.uid); + code = tsdbSnapCmprData(pReader, ppData); TSDB_CHECK_CODE(code, lino, _exit); } diff --git a/source/dnode/vnode/src/tsdb/tsdbUtil.c b/source/dnode/vnode/src/tsdb/tsdbUtil.c index fb0307969d..4e051b8b30 100644 --- a/source/dnode/vnode/src/tsdb/tsdbUtil.c +++ b/source/dnode/vnode/src/tsdb/tsdbUtil.c @@ -1133,6 +1133,7 @@ _exit: void tBlockDataReset(SBlockData *pBlockData) { pBlockData->suid = 0; pBlockData->uid = 0; + pBlockData->nRow = 0; } void tBlockDataClear(SBlockData *pBlockData) { -- GitLab