From f830fc2f4c0c61c8f7175e27e02e6b2ff501bfa4 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Fri, 8 Dec 2023 17:26:44 +0800 Subject: [PATCH] more dev --- source/dnode/vnode/src/inc/vnd.h | 1 - source/dnode/vnode/src/vnd/vnodeQuery.c | 21 +++++------------- source/dnode/vnode/src/vnd/vnodeSvr.c | 29 ++++++------------------- 3 files changed, 13 insertions(+), 38 deletions(-) diff --git a/source/dnode/vnode/src/inc/vnd.h b/source/dnode/vnode/src/inc/vnd.h index b358efe691..4036200d73 100644 --- a/source/dnode/vnode/src/inc/vnd.h +++ b/source/dnode/vnode/src/inc/vnd.h @@ -120,7 +120,6 @@ void vnodeQueryClose(SVnode* pVnode); int32_t vnodeGetTableMeta(SVnode* pVnode, SRpcMsg* pMsg, bool direct); int vnodeGetTableCfg(SVnode* pVnode, SRpcMsg* pMsg, bool direct); int32_t vnodeGetBatchMeta(SVnode* pVnode, SRpcMsg* pMsg); -int32_t vnodeQueryCompactProgress(SVnode *pVnode, SRpcMsg *pMsg); // vnodeCommit.c int32_t vnodeBegin(SVnode* pVnode); diff --git a/source/dnode/vnode/src/vnd/vnodeQuery.c b/source/dnode/vnode/src/vnd/vnodeQuery.c index 7377850cf6..b6a9360afd 100644 --- a/source/dnode/vnode/src/vnd/vnodeQuery.c +++ b/source/dnode/vnode/src/vnd/vnodeQuery.c @@ -374,15 +374,6 @@ _exit: return code; } -int32_t vnodeQueryCompactProgress(SVnode *pVnode, SRpcMsg *pMsg){ - SQueryCompactProgressReq req; - - if (tDeserializeSQueryCompactProgressReq(pMsg->pCont, pMsg->contLen, &req)) { - - } - return 0; -} - int32_t vnodeGetLoad(SVnode *pVnode, SVnodeLoad *pLoad) { SSyncState state = syncGetState(pVnode->sync); @@ -432,9 +423,9 @@ void vnodeResetLoad(SVnode *pVnode, SVnodeLoad *pLoad) { "nBatchInsertSuccess"); } -void vnodeGetInfo(void *pVnode, const char **dbname, int32_t *vgId, int64_t* numOfTables, int64_t* numOfNormalTables) { - SVnode* pVnodeObj = pVnode; - SVnodeCfg* pConf = &pVnodeObj->config; +void vnodeGetInfo(void *pVnode, const char **dbname, int32_t *vgId, int64_t *numOfTables, int64_t *numOfNormalTables) { + SVnode *pVnodeObj = pVnode; + SVnodeCfg *pConf = &pVnodeObj->config; if (dbname) { *dbname = pConf->dbname; @@ -453,7 +444,7 @@ void vnodeGetInfo(void *pVnode, const char **dbname, int32_t *vgId, int64_t* num } } -int32_t vnodeGetTableList(void* pVnode, int8_t type, SArray* pList) { +int32_t vnodeGetTableList(void *pVnode, int8_t type, SArray *pList) { if (type == TSDB_SUPER_TABLE) { return vnodeGetStbIdList(pVnode, 0, pList); } else { @@ -703,12 +694,12 @@ void *vnodeGetIdx(void *pVnode) { return NULL; } - return metaGetIdx(((SVnode*)pVnode)->pMeta); + return metaGetIdx(((SVnode *)pVnode)->pMeta); } void *vnodeGetIvtIdx(void *pVnode) { if (pVnode == NULL) { return NULL; } - return metaGetIvtIdx(((SVnode*)pVnode)->pMeta); + return metaGetIvtIdx(((SVnode *)pVnode)->pMeta); } diff --git a/source/dnode/vnode/src/vnd/vnodeSvr.c b/source/dnode/vnode/src/vnd/vnodeSvr.c index 1035c61a97..df26966983 100644 --- a/source/dnode/vnode/src/vnd/vnodeSvr.c +++ b/source/dnode/vnode/src/vnd/vnodeSvr.c @@ -22,8 +22,6 @@ #include "vnode.h" #include "vnodeInt.h" -extern int32_t tsdbStopAllCompTask(STsdb *tsdb); - static int32_t vnodeProcessCreateStbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessAlterStbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessDropStbReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); @@ -44,7 +42,9 @@ static int32_t vnodeProcessCreateIndexReq(SVnode *pVnode, int64_t ver, void *pRe static int32_t vnodeProcessDropIndexReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessCompactVnodeReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); static int32_t vnodeProcessConfigChangeReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); -static int32_t vnodeProcessKillCompactReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); + +extern int32_t vnodeProcessKillCompactReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp); +extern int32_t vnodeQueryCompactProgress(SVnode *pVnode, SRpcMsg *pMsg); static int32_t vnodePreprocessCreateTableReq(SVnode *pVnode, SDecoder *pCoder, int64_t btime, int64_t *pUid) { int32_t code = 0; @@ -627,15 +627,12 @@ int32_t vnodeProcessWriteMsg(SVnode *pVnode, SRpcMsg *pMsg, int64_t ver, SRpcMsg case TDMT_VND_COMPACT: vnodeProcessCompactVnodeReq(pVnode, ver, pReq, len, pRsp); goto _exit; - case TDMT_VND_KILL_COMPACT: - vnodeProcessKillCompactReq(pVnode, ver, pReq, len, pRsp); - break; case TDMT_SYNC_CONFIG_CHANGE: vnodeProcessConfigChangeReq(pVnode, ver, pReq, len, pRsp); break; -#ifndef TD_ENTERPRISE +#ifdef TD_ENTERPRISE case TDMT_VND_KILL_COMPACT: - tsdbStopAllCompTask(pVnode->pTsdb); + vnodeProcessKillCompactReq(pVnode, ver, pReq, len, pRsp); break; #endif default: @@ -747,8 +744,10 @@ int32_t vnodeProcessFetchMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo) { return vnodeGetTableCfg(pVnode, pMsg, true); case TDMT_VND_BATCH_META: return vnodeGetBatchMeta(pVnode, pMsg); +#ifdef TD_ENTERPRISE case TDMT_VND_QUERY_COMPACT_PROGRESS: return vnodeQueryCompactProgress(pVnode, pMsg); +#endif // case TDMT_VND_TMQ_CONSUME: // return tqProcessPollReq(pVnode->pTq, pMsg); case TDMT_VND_TMQ_VG_WALINFO: @@ -2056,15 +2055,6 @@ static int32_t vnodeProcessCompactVnodeReq(SVnode *pVnode, int64_t ver, void *pR return vnodeProcessCompactVnodeReqImpl(pVnode, ver, pReq, len, pRsp); } -static int32_t vnodeProcessKillCompactReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp){ - return 0; -} - -static int32_t vnodeProcessStopCompactReq(SVnode *pVnode) { - // TODO - return 0; -} - static int32_t vnodeProcessConfigChangeReq(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp) { syncCheckMember(pVnode->sync); @@ -2080,9 +2070,4 @@ static int32_t vnodeProcessConfigChangeReq(SVnode *pVnode, int64_t ver, void *pR int32_t vnodeProcessCompactVnodeReqImpl(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp) { return 0; } - -int32_t vnodeQueryCompactProgress(SVnode *pVnode, int64_t ver, void *pReq, int32_t len, SRpcMsg *pRsp) { - // tsdbCompMonitorGetInfo(STsdb * tsdb, SCompMonInfo * info); - return 0; -} #endif