From 0e401a346f24420da72d961f7c20f59fe4a2b69e Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Tue, 31 May 2022 05:37:10 +0000 Subject: [PATCH] more --- include/common/tmsg.h | 16 ++++++++++++++++ include/common/tmsgdef.h | 2 ++ source/dnode/vnode/src/inc/tsdb.h | 6 ++++++ source/dnode/vnode/src/tsdb/tsdbMemTable.c | 2 +- 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 37e4cc5e8c..54676a0382 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -2632,6 +2632,22 @@ typedef struct { int32_t tEncodeSVSubmitReq(SEncoder* pCoder, const SVSubmitReq* pReq); int32_t tDecodeSVSubmitReq(SDecoder* pCoder, SVSubmitReq* pReq); +// TDMT_VND_DELETE +typedef struct { + TSKEY sKey; + TSKEY eKey; + + // super table + char* stbName; + + // child/normal + char* tbName; +} SVDeleteReq; + +typedef struct { + // TODO +} SVDeleteRsp; + #pragma pack(pop) #ifdef __cplusplus diff --git a/include/common/tmsgdef.h b/include/common/tmsgdef.h index 51a15c1489..62517a9a14 100644 --- a/include/common/tmsgdef.h +++ b/include/common/tmsgdef.h @@ -226,6 +226,8 @@ enum { TD_DEF_MSG_TYPE(TDMT_VND_ALTER_VNODE, "vnode-alter-vnode", NULL, NULL) TD_DEF_MSG_TYPE(TDMT_VND_COMPACT_VNODE, "vnode-compact-vnode", NULL, NULL) + TD_DEF_MSG_TYPE(TDMT_VND_DELETE, "vnode-delete-data", SVDeleteReq, SVDeleteRsp) + // Requests handled by QNODE TD_NEW_MSG_SEG(TDMT_QND_MSG) diff --git a/source/dnode/vnode/src/inc/tsdb.h b/source/dnode/vnode/src/inc/tsdb.h index 2e4ff6a4ab..e5f163a03b 100644 --- a/source/dnode/vnode/src/inc/tsdb.h +++ b/source/dnode/vnode/src/inc/tsdb.h @@ -33,6 +33,7 @@ extern "C" { // clang-format on // tsdbMemTable ================ +typedef struct STsdbRow STsdbRow; typedef struct STbData STbData; typedef struct STsdbMemTable STsdbMemTable; typedef struct SMergeInfo SMergeInfo; @@ -845,6 +846,11 @@ static FORCE_INLINE int tsdbUnLockFS(STsdbFS *pFs) { return 0; } +struct STsdbRow { + int64_t version; + STSRow row; +}; + #endif #ifdef __cplusplus diff --git a/source/dnode/vnode/src/tsdb/tsdbMemTable.c b/source/dnode/vnode/src/tsdb/tsdbMemTable.c index 9b9a431b50..99a4d78c6f 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMemTable.c +++ b/source/dnode/vnode/src/tsdb/tsdbMemTable.c @@ -321,7 +321,7 @@ int tsdbInsertTableData(STsdb *pTsdb, SSubmitMsgIter *pMsgIter, SSubmitBlk *pBlo terrno = TSDB_CODE_PAR_TABLE_NOT_EXIST; return -1; } - if(pRsp->tblFName) strcat(pRsp->tblFName, mr.me.name); + if (pRsp->tblFName) strcat(pRsp->tblFName, mr.me.name); if (mr.me.type == TSDB_NORMAL_TABLE) { sverNew = mr.me.ntbEntry.schemaRow.version; -- GitLab