From 9ee563996d8377c8ad33aebef7a9754f32f386fb Mon Sep 17 00:00:00 2001 From: hzcheng Date: Mon, 4 May 2020 21:41:03 +0800 Subject: [PATCH] add uid to SCompIdx --- src/tsdb/inc/tsdbMain.h | 5 +++-- src/tsdb/src/tsdbRWHelper.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tsdb/inc/tsdbMain.h b/src/tsdb/inc/tsdbMain.h index 39808ab02f..22d0691416 100644 --- a/src/tsdb/inc/tsdbMain.h +++ b/src/tsdb/inc/tsdbMain.h @@ -261,11 +261,12 @@ SFileGroup *tsdbGetFileGroupNext(SFileGroupIter *pIter); typedef struct { int32_t len; int32_t offset; + int32_t padding; // For padding purpose int32_t hasLast : 1; int32_t numOfBlocks : 31; - int32_t checksum; + int64_t uid; TSKEY maxKey; -} SCompIdx; /* sizeof(SCompIdx) = 24 */ +} SCompIdx; /* sizeof(SCompIdx) = 28 */ /** * if numOfSubBlocks == 0, then the SCompBlock is a sub-block diff --git a/src/tsdb/src/tsdbRWHelper.c b/src/tsdb/src/tsdbRWHelper.c index 653379e03b..e32a646296 100644 --- a/src/tsdb/src/tsdbRWHelper.c +++ b/src/tsdb/src/tsdbRWHelper.c @@ -414,6 +414,7 @@ int tsdbWriteCompInfo(SRWHelper *pHelper) { ASSERT((pIdx->len - sizeof(SCompInfo) - sizeof(TSCKSUM)) % sizeof(SCompBlock) == 0); taosCalcChecksumAppend(0, (uint8_t *)pHelper->pCompInfo, pIdx->len); pIdx->offset = lseek(pHelper->files.nHeadF.fd, 0, SEEK_END); + pIdx->uid = pHelper->tableInfo.uid; if (pIdx->offset < 0) return -1; ASSERT(pIdx->offset >= tsizeof(pHelper->pCompIdx)); -- GitLab