From 3083189f4d9fc8906157b33c0d206637eca87c2b Mon Sep 17 00:00:00 2001 From: kailixu Date: Mon, 25 Sep 2023 12:35:18 +0800 Subject: [PATCH 1/7] grant: enable update cluster info --- source/dnode/mgmt/mgmt_dnode/src/dmWorker.c | 2 -- source/dnode/mnode/impl/src/mndDnode.c | 4 ---- 2 files changed, 6 deletions(-) diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c b/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c index 5b2bd0783a..4cd7a9f951 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c @@ -294,9 +294,7 @@ static void dmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) { code = dmProcessGrantReq(&pMgmt->pData->clusterId, pMsg); break; case TDMT_MND_GRANT_NOTIFY: -#ifdef MAKE_JENKINS_HAPPY code = dmProcessGrantNotify(NULL, pMsg); -#endif break; default: terrno = TSDB_CODE_MSG_NOT_PROCESSED; diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index a2c7f7b5cf..95a8f873cb 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -688,9 +688,7 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) { _OVER: mndReleaseDnode(pMnode, pDnode); taosArrayDestroy(statusReq.pVloads); -#ifdef MAKE_JENKINS_HAPPY mndUpdClusterInfo(pReq); -#endif return code; } @@ -723,9 +721,7 @@ static int32_t mndProcessNotifyReq(SRpcMsg *pReq) { } } _OVER: -#ifdef MAKE_JENKINS_HAPPY mndUpdClusterInfo(pReq); -#endif tFreeSNotifyReq(¬ifyReq); return code; } From 4e0a5cb91ab4aff5a71cce4d7f47b515a7418c2e Mon Sep 17 00:00:00 2001 From: kailixu Date: Mon, 25 Sep 2023 14:46:59 +0800 Subject: [PATCH 2/7] chore: macOS compile --- source/dnode/mgmt/mgmt_dnode/src/dmWorker.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c b/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c index 4cd7a9f951..d97ac79ed1 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c @@ -294,7 +294,9 @@ static void dmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) { code = dmProcessGrantReq(&pMgmt->pData->clusterId, pMsg); break; case TDMT_MND_GRANT_NOTIFY: +#ifndef _TD_DARWIN_64 code = dmProcessGrantNotify(NULL, pMsg); +#endif break; default: terrno = TSDB_CODE_MSG_NOT_PROCESSED; From f689ef8fe42d3f26b6047332606a85ff2bb442cf Mon Sep 17 00:00:00 2001 From: kailixu Date: Mon, 25 Sep 2023 15:41:23 +0800 Subject: [PATCH 3/7] chore: make jenkins happy --- source/dnode/mnode/impl/src/mndDnode.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index 95a8f873cb..db6d96f2f7 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -688,7 +688,9 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) { _OVER: mndReleaseDnode(pMnode, pDnode); taosArrayDestroy(statusReq.pVloads); +#ifndef _TD_DARWIN_64 mndUpdClusterInfo(pReq); +#endif return code; } @@ -721,7 +723,9 @@ static int32_t mndProcessNotifyReq(SRpcMsg *pReq) { } } _OVER: +#ifndef _TD_DARWIN_64 mndUpdClusterInfo(pReq); +#endif tFreeSNotifyReq(¬ifyReq); return code; } From b0b4d782fc27f22585eb2838bc9d6496ca6f9d70 Mon Sep 17 00:00:00 2001 From: kailixu Date: Mon, 25 Sep 2023 15:57:54 +0800 Subject: [PATCH 4/7] chore: code refactor --- source/dnode/mgmt/mgmt_dnode/inc/dmInt.h | 1 - source/dnode/mgmt/mgmt_dnode/src/dmInt.c | 2 +- source/dnode/mgmt/mgmt_dnode/src/dmWorker.c | 7 +++++-- source/dnode/mnode/impl/src/mndDnode.c | 10 +++------- source/dnode/vnode/src/meta/metaTable.c | 2 +- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/source/dnode/mgmt/mgmt_dnode/inc/dmInt.h b/source/dnode/mgmt/mgmt_dnode/inc/dmInt.h index 9e43c2af47..75246cc5c0 100644 --- a/source/dnode/mgmt/mgmt_dnode/inc/dmInt.h +++ b/source/dnode/mgmt/mgmt_dnode/inc/dmInt.h @@ -53,7 +53,6 @@ int32_t dmProcessGrantRsp(SDnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t dmProcessServerRunStatus(SDnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t dmProcessRetrieve(SDnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t dmProcessGrantReq(void *pInfo, SRpcMsg *pMsg); -int32_t dmProcessGrantNotify(void *pInfo, SRpcMsg *pMsg); // dmWorker.c int32_t dmPutNodeMsgToMgmtQueue(SDnodeMgmt *pMgmt, SRpcMsg *pMsg); diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmInt.c b/source/dnode/mgmt/mgmt_dnode/src/dmInt.c index 966891feb8..fd9f4fccbe 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmInt.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmInt.c @@ -20,7 +20,7 @@ static int32_t dmStartMgmt(SDnodeMgmt *pMgmt) { if (dmStartStatusThread(pMgmt) != 0) { return -1; } -#ifdef TD_ENTERPRISE +#if defined(TD_ENTERPRISE) && !defined(_TD_DARWIN_64) if (dmStartNotifyThread(pMgmt) != 0) { return -1; } diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c b/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c index d97ac79ed1..ee7c470b12 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c @@ -246,6 +246,11 @@ void dmStopCrashReportThread(SDnodeMgmt *pMgmt) { } } +#if defined(TD_ENTERPRISE) && !defined(_TD_DARWIN_64) +int32_t dmProcessGrantNotify(void *pInfo, SRpcMsg *pMsg); +#else +static int32_t dmProcessGrantNotify(void *pInfo, SRpcMsg *pMsg) { return 0; } +#endif static void dmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) { SDnodeMgmt *pMgmt = pInfo->ahandle; @@ -294,9 +299,7 @@ static void dmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) { code = dmProcessGrantReq(&pMgmt->pData->clusterId, pMsg); break; case TDMT_MND_GRANT_NOTIFY: -#ifndef _TD_DARWIN_64 code = dmProcessGrantNotify(NULL, pMsg); -#endif break; default: terrno = TSDB_CODE_MSG_NOT_PROCESSED; diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index db6d96f2f7..c6209f281e 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -81,10 +81,10 @@ static void mndCancelGetNextDnode(SMnode *pMnode, void *pIter); static int32_t mndMCfgGetValInt32(SMCfgDnodeReq *pInMCfgReq, int32_t opLen, int32_t *pOutValue); -#ifndef TD_ENTERPRISE -static int32_t mndUpdClusterInfo(SRpcMsg *pReq) { return 0; } -#else +#if defined(TD_ENTERPRISE) && !defined(_TD_DARWIN_64) int32_t mndUpdClusterInfo(SRpcMsg *pReq); +#else +static int32_t mndUpdClusterInfo(SRpcMsg *pReq) { return 0; } #endif int32_t mndInitDnode(SMnode *pMnode) { @@ -688,9 +688,7 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) { _OVER: mndReleaseDnode(pMnode, pDnode); taosArrayDestroy(statusReq.pVloads); -#ifndef _TD_DARWIN_64 mndUpdClusterInfo(pReq); -#endif return code; } @@ -723,9 +721,7 @@ static int32_t mndProcessNotifyReq(SRpcMsg *pReq) { } } _OVER: -#ifndef _TD_DARWIN_64 mndUpdClusterInfo(pReq); -#endif tFreeSNotifyReq(¬ifyReq); return code; } diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c index 0a25bdc9c7..f065fe3268 100644 --- a/source/dnode/vnode/src/meta/metaTable.c +++ b/source/dnode/vnode/src/meta/metaTable.c @@ -195,7 +195,7 @@ int metaDelJsonVarFromIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry, const SSche } static inline void metaTimeSeriesNotifyCheck(SMeta *pMeta) { -#ifdef TD_ENTERPRISE +#if defined(TD_ENTERPRISE) && !defined(_TD_DARWIN_64) int64_t nTimeSeries = metaGetTimeSeriesNum(pMeta, 0); int64_t deltaTS = nTimeSeries - pMeta->pVnode->config.vndStats.numOfReportedTimeSeries; if (deltaTS > tsTimeSeriesThreshold) tsem_post(&dmNotifySem); From 68fb1b296fcdb2ef9bf09a962614d53df8497996 Mon Sep 17 00:00:00 2001 From: kailixu Date: Mon, 25 Sep 2023 16:16:12 +0800 Subject: [PATCH 5/7] chore: code refactor --- source/dnode/mgmt/mgmt_dnode/inc/dmInt.h | 1 + source/dnode/mgmt/mgmt_dnode/src/dmWorker.c | 6 ------ source/dnode/mnode/impl/src/mndDnode.c | 2 +- source/dnode/mnode/impl/src/mndGrant.c | 3 ++- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/source/dnode/mgmt/mgmt_dnode/inc/dmInt.h b/source/dnode/mgmt/mgmt_dnode/inc/dmInt.h index 75246cc5c0..9e43c2af47 100644 --- a/source/dnode/mgmt/mgmt_dnode/inc/dmInt.h +++ b/source/dnode/mgmt/mgmt_dnode/inc/dmInt.h @@ -53,6 +53,7 @@ int32_t dmProcessGrantRsp(SDnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t dmProcessServerRunStatus(SDnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t dmProcessRetrieve(SDnodeMgmt *pMgmt, SRpcMsg *pMsg); int32_t dmProcessGrantReq(void *pInfo, SRpcMsg *pMsg); +int32_t dmProcessGrantNotify(void *pInfo, SRpcMsg *pMsg); // dmWorker.c int32_t dmPutNodeMsgToMgmtQueue(SDnodeMgmt *pMgmt, SRpcMsg *pMsg); diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c b/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c index ee7c470b12..f567267ff8 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmWorker.c @@ -246,12 +246,6 @@ void dmStopCrashReportThread(SDnodeMgmt *pMgmt) { } } -#if defined(TD_ENTERPRISE) && !defined(_TD_DARWIN_64) -int32_t dmProcessGrantNotify(void *pInfo, SRpcMsg *pMsg); -#else -static int32_t dmProcessGrantNotify(void *pInfo, SRpcMsg *pMsg) { return 0; } -#endif - static void dmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) { SDnodeMgmt *pMgmt = pInfo->ahandle; int32_t code = -1; diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index c6209f281e..260fe4a9f4 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -81,7 +81,7 @@ static void mndCancelGetNextDnode(SMnode *pMnode, void *pIter); static int32_t mndMCfgGetValInt32(SMCfgDnodeReq *pInMCfgReq, int32_t opLen, int32_t *pOutValue); -#if defined(TD_ENTERPRISE) && !defined(_TD_DARWIN_64) +#ifdef _GRANT int32_t mndUpdClusterInfo(SRpcMsg *pReq); #else static int32_t mndUpdClusterInfo(SRpcMsg *pReq) { return 0; } diff --git a/source/dnode/mnode/impl/src/mndGrant.c b/source/dnode/mnode/impl/src/mndGrant.c index 1b46e16961..c4c5e0355d 100644 --- a/source/dnode/mnode/impl/src/mndGrant.c +++ b/source/dnode/mnode/impl/src/mndGrant.c @@ -129,7 +129,8 @@ void grantParseParameter() { mError("can't parsed parameter k"); } void grantReset(SMnode *pMnode, EGrantType grant, uint64_t value) {} void grantAdd(EGrantType grant, uint64_t value) {} void grantRestore(EGrantType grant, uint64_t value) {} -int32_t dmProcessGrantReq(void* pInfo, SRpcMsg *pMsg) { return TSDB_CODE_SUCCESS; } +int32_t dmProcessGrantReq(void *pInfo, SRpcMsg *pMsg) { return TSDB_CODE_SUCCESS; } +int32_t dmProcessGrantNotify(void *pInfo, SRpcMsg *pMsg) { return TSDB_CODE_SUCCESS; } #endif From 0632fb838ad0fce3fac1a58d35e34950da29e286 Mon Sep 17 00:00:00 2001 From: kailixu Date: Mon, 25 Sep 2023 16:17:57 +0800 Subject: [PATCH 6/7] chore: code refactor --- source/dnode/mgmt/mgmt_dnode/src/dmInt.c | 2 +- source/dnode/vnode/src/meta/metaTable.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmInt.c b/source/dnode/mgmt/mgmt_dnode/src/dmInt.c index fd9f4fccbe..63cea5b5ef 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmInt.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmInt.c @@ -20,7 +20,7 @@ static int32_t dmStartMgmt(SDnodeMgmt *pMgmt) { if (dmStartStatusThread(pMgmt) != 0) { return -1; } -#if defined(TD_ENTERPRISE) && !defined(_TD_DARWIN_64) +#ifdef _GRANT if (dmStartNotifyThread(pMgmt) != 0) { return -1; } diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c index f065fe3268..a72c215baa 100644 --- a/source/dnode/vnode/src/meta/metaTable.c +++ b/source/dnode/vnode/src/meta/metaTable.c @@ -195,7 +195,7 @@ int metaDelJsonVarFromIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry, const SSche } static inline void metaTimeSeriesNotifyCheck(SMeta *pMeta) { -#if defined(TD_ENTERPRISE) && !defined(_TD_DARWIN_64) +#ifdef _GRANT int64_t nTimeSeries = metaGetTimeSeriesNum(pMeta, 0); int64_t deltaTS = nTimeSeries - pMeta->pVnode->config.vndStats.numOfReportedTimeSeries; if (deltaTS > tsTimeSeriesThreshold) tsem_post(&dmNotifySem); From 126a371170d019956b0ca881cdf979bbebf31e46 Mon Sep 17 00:00:00 2001 From: kailixu Date: Mon, 25 Sep 2023 16:24:03 +0800 Subject: [PATCH 7/7] chore: more code --- source/dnode/mgmt/mgmt_dnode/src/dmInt.c | 2 +- source/dnode/vnode/src/meta/metaTable.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dnode/mgmt/mgmt_dnode/src/dmInt.c b/source/dnode/mgmt/mgmt_dnode/src/dmInt.c index 63cea5b5ef..fd9f4fccbe 100644 --- a/source/dnode/mgmt/mgmt_dnode/src/dmInt.c +++ b/source/dnode/mgmt/mgmt_dnode/src/dmInt.c @@ -20,7 +20,7 @@ static int32_t dmStartMgmt(SDnodeMgmt *pMgmt) { if (dmStartStatusThread(pMgmt) != 0) { return -1; } -#ifdef _GRANT +#if defined(TD_ENTERPRISE) && !defined(_TD_DARWIN_64) if (dmStartNotifyThread(pMgmt) != 0) { return -1; } diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c index a72c215baa..f065fe3268 100644 --- a/source/dnode/vnode/src/meta/metaTable.c +++ b/source/dnode/vnode/src/meta/metaTable.c @@ -195,7 +195,7 @@ int metaDelJsonVarFromIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry, const SSche } static inline void metaTimeSeriesNotifyCheck(SMeta *pMeta) { -#ifdef _GRANT +#if defined(TD_ENTERPRISE) && !defined(_TD_DARWIN_64) int64_t nTimeSeries = metaGetTimeSeriesNum(pMeta, 0); int64_t deltaTS = nTimeSeries - pMeta->pVnode->config.vndStats.numOfReportedTimeSeries; if (deltaTS > tsTimeSeriesThreshold) tsem_post(&dmNotifySem);