diff --git a/source/dnode/vnode/src/tsdb/dev/tsdbCommit.c b/source/dnode/vnode/src/tsdb/dev/tsdbCommit.c index 28b7a6276a..a3d6fc2faf 100644 --- a/source/dnode/vnode/src/tsdb/dev/tsdbCommit.c +++ b/source/dnode/vnode/src/tsdb/dev/tsdbCommit.c @@ -327,7 +327,6 @@ _exit: return code; } -#if 0 int32_t tsdbCommitCommit(STsdb *pTsdb) { int32_t code = 0; int32_t lino = 0; @@ -373,5 +372,4 @@ _exit: tsdbInfo("vgId:%d, tsdb rollback commit", TD_VID(pTsdb->pVnode)); } return code; -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/source/dnode/vnode/src/tsdb/dev/tsdbFSet.h b/source/dnode/vnode/src/tsdb/dev/tsdbFSet.h index 57cbd22609..33cd13df7e 100644 --- a/source/dnode/vnode/src/tsdb/dev/tsdbFSet.h +++ b/source/dnode/vnode/src/tsdb/dev/tsdbFSet.h @@ -24,15 +24,22 @@ extern "C" { /* Exposed Handle */ struct SFileSet; +struct SSttFileLayer { + int32_t level; + int32_t nFile; + struct STFile *fileList; +}; + +#define TSDB_STT_FILE_LEVEL_MAX 3 /* Exposed APIs */ /* Exposed Structs */ struct SFileSet { - int32_t fid; - int64_t nextid; - struct STFile *files[TSDB_FTYPE_MAX]; - SRBTree fsttTree; + int32_t fid; + int64_t nextid; + struct STFile *files[TSDB_FTYPE_MAX]; + struct SSttFileLayer sttLayers[TSDB_STT_FILE_LEVEL_MAX]; }; #ifdef __cplusplus diff --git a/source/dnode/vnode/src/tsdb/dev/tsdbFileOp.h b/source/dnode/vnode/src/tsdb/dev/tsdbFileOp.h index 30ea8b6aca..081c0407b6 100644 --- a/source/dnode/vnode/src/tsdb/dev/tsdbFileOp.h +++ b/source/dnode/vnode/src/tsdb/dev/tsdbFileOp.h @@ -30,8 +30,9 @@ typedef enum { } EFileOpType; struct SFileOp { - EFileOpType op; - // TODO + EFileOpType op; + struct STFile oFile; // old file state + struct STFile nFile; // new file state }; /* Exposed APIs */ diff --git a/source/dnode/vnode/src/tsdb/dev/tsdbSttFWriter.c b/source/dnode/vnode/src/tsdb/dev/tsdbSttFWriter.c index 5102d9c720..d67a41626c 100644 --- a/source/dnode/vnode/src/tsdb/dev/tsdbSttFWriter.c +++ b/source/dnode/vnode/src/tsdb/dev/tsdbSttFWriter.c @@ -22,8 +22,9 @@ extern int32_t tsdbReadFile(STsdbFD *pFD, int64_t offset, uint8_t *pBuf, int64_t extern int32_t tsdbFsyncFile(STsdbFD *pFD); typedef struct { + int64_t prevFooter; SFDataPtr dict[4]; // 0:bloom filter, 1:SSttBlk, 2:STbStatisBlk, 3:SDelBlk - uint8_t reserved[32]; + uint8_t reserved[24]; } SFSttFooter; struct SSttFWriter {