From b7ea583f3aa845fad0ebc74303bd5476bbbd9cfa Mon Sep 17 00:00:00 2001 From: kailixu Date: Fri, 19 Jan 2024 17:01:19 +0800 Subject: [PATCH] feat: support uniq grant --- include/util/taoserror.h | 1 + source/dnode/mnode/impl/inc/mndDef.h | 2 +- source/dnode/mnode/impl/inc/mndGrant.h | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/util/taoserror.h b/include/util/taoserror.h index f1f51c812d..827567904a 100644 --- a/include/util/taoserror.h +++ b/include/util/taoserror.h @@ -566,6 +566,7 @@ int32_t* taosGetErrno(); #define TSDB_CODE_GRANT_PAR_IVLD_DIST TAOS_DEF_ERROR_CODE(0, 0x0815) #define TSDB_CODE_GRANT_UNLICENSED_CLUSTER TAOS_DEF_ERROR_CODE(0, 0x0816) #define TSDB_CODE_GRANT_LACK_OF_BASIC TAOS_DEF_ERROR_CODE(0, 0x0817) +#define TSDB_CODE_GRANT_OBJ_NOT_EXIST TAOS_DEF_ERROR_CODE(0, 0x0818) // sync // #define TSDB_CODE_SYN_INVALID_CONFIG TAOS_DEF_ERROR_CODE(0, 0x0900) // 2.x diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index 45c21e06ac..aef636b6bc 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -831,7 +831,7 @@ typedef struct { int8_t nActives; int64_t createTime; int64_t updateTime; - SGrantState stats[GRANT_STATE_NUM]; + SGrantState states[GRANT_STATE_NUM]; SGrantActive actives[GRANT_ACTIVE_NUM]; char* active; SArray* pMachines; // SGrantMachines diff --git a/source/dnode/mnode/impl/inc/mndGrant.h b/source/dnode/mnode/impl/inc/mndGrant.h index ae9612d473..704dbf7fa1 100644 --- a/source/dnode/mnode/impl/inc/mndGrant.h +++ b/source/dnode/mnode/impl/inc/mndGrant.h @@ -41,6 +41,8 @@ int32_t mndProcessConfigGrantReq(SRpcMsg * pReq, SMCfgClusterReq * pCfg); int32_t mndProcessUpdMachineReq(SRpcMsg * pReq, SArray *pMachines); int32_t mndProcessUpdStateReq(SRpcMsg * pReq, SGrantState *pState); + + int32_t mndGrantGetLastState(SMnode * pMnode, SGrantState * pState); #endif #ifdef __cplusplus