Merge pull request #23037 from taosdata/enh/TS-3812-3.0

grant: enable update cluster info
This commit is contained in:
wade zhang 2023-09-25 19:27:44 +08:00 committed by GitHub
commit f2a7795cd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 13 deletions

View File

@ -20,7 +20,7 @@ static int32_t dmStartMgmt(SDnodeMgmt *pMgmt) {
if (dmStartStatusThread(pMgmt) != 0) { if (dmStartStatusThread(pMgmt) != 0) {
return -1; return -1;
} }
#ifdef TD_ENTERPRISE #if defined(TD_ENTERPRISE) && !defined(_TD_DARWIN_64)
if (dmStartNotifyThread(pMgmt) != 0) { if (dmStartNotifyThread(pMgmt) != 0) {
return -1; return -1;
} }

View File

@ -246,7 +246,6 @@ void dmStopCrashReportThread(SDnodeMgmt *pMgmt) {
} }
} }
static void dmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) { static void dmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
SDnodeMgmt *pMgmt = pInfo->ahandle; SDnodeMgmt *pMgmt = pInfo->ahandle;
int32_t code = -1; int32_t code = -1;
@ -294,9 +293,7 @@ static void dmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
code = dmProcessGrantReq(&pMgmt->pData->clusterId, pMsg); code = dmProcessGrantReq(&pMgmt->pData->clusterId, pMsg);
break; break;
case TDMT_MND_GRANT_NOTIFY: case TDMT_MND_GRANT_NOTIFY:
#ifdef MAKE_JENKINS_HAPPY
code = dmProcessGrantNotify(NULL, pMsg); code = dmProcessGrantNotify(NULL, pMsg);
#endif
break; break;
default: default:
terrno = TSDB_CODE_MSG_NOT_PROCESSED; terrno = TSDB_CODE_MSG_NOT_PROCESSED;

View File

@ -81,10 +81,10 @@ static void mndCancelGetNextDnode(SMnode *pMnode, void *pIter);
static int32_t mndMCfgGetValInt32(SMCfgDnodeReq *pInMCfgReq, int32_t opLen, int32_t *pOutValue); static int32_t mndMCfgGetValInt32(SMCfgDnodeReq *pInMCfgReq, int32_t opLen, int32_t *pOutValue);
#ifndef TD_ENTERPRISE #ifdef _GRANT
static int32_t mndUpdClusterInfo(SRpcMsg *pReq) { return 0; }
#else
int32_t mndUpdClusterInfo(SRpcMsg *pReq); int32_t mndUpdClusterInfo(SRpcMsg *pReq);
#else
static int32_t mndUpdClusterInfo(SRpcMsg *pReq) { return 0; }
#endif #endif
int32_t mndInitDnode(SMnode *pMnode) { int32_t mndInitDnode(SMnode *pMnode) {
@ -688,9 +688,7 @@ static int32_t mndProcessStatusReq(SRpcMsg *pReq) {
_OVER: _OVER:
mndReleaseDnode(pMnode, pDnode); mndReleaseDnode(pMnode, pDnode);
taosArrayDestroy(statusReq.pVloads); taosArrayDestroy(statusReq.pVloads);
#ifdef MAKE_JENKINS_HAPPY
mndUpdClusterInfo(pReq); mndUpdClusterInfo(pReq);
#endif
return code; return code;
} }
@ -723,9 +721,7 @@ static int32_t mndProcessNotifyReq(SRpcMsg *pReq) {
} }
} }
_OVER: _OVER:
#ifdef MAKE_JENKINS_HAPPY
mndUpdClusterInfo(pReq); mndUpdClusterInfo(pReq);
#endif
tFreeSNotifyReq(&notifyReq); tFreeSNotifyReq(&notifyReq);
return code; return code;
} }

View File

@ -130,6 +130,7 @@ void grantReset(SMnode *pMnode, EGrantType grant, uint64_t value) {}
void grantAdd(EGrantType grant, uint64_t value) {} void grantAdd(EGrantType grant, uint64_t value) {}
void grantRestore(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 #endif

View File

@ -195,7 +195,7 @@ int metaDelJsonVarFromIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry, const SSche
} }
static inline void metaTimeSeriesNotifyCheck(SMeta *pMeta) { 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 nTimeSeries = metaGetTimeSeriesNum(pMeta, 0);
int64_t deltaTS = nTimeSeries - pMeta->pVnode->config.vndStats.numOfReportedTimeSeries; int64_t deltaTS = nTimeSeries - pMeta->pVnode->config.vndStats.numOfReportedTimeSeries;
if (deltaTS > tsTimeSeriesThreshold) tsem_post(&dmNotifySem); if (deltaTS > tsTimeSeriesThreshold) tsem_post(&dmNotifySem);