From a11410378ff065540878f0c33f0ec28fb9c1f0f1 Mon Sep 17 00:00:00 2001 From: kailixu Date: Wed, 31 Jan 2024 09:47:10 +0800 Subject: [PATCH] feat: support uniq grant --- source/dnode/mnode/impl/inc/mndDef.h | 4 ++-- source/dnode/mnode/impl/inc/mndGrant.h | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index ec0483b0d4..c5ac124eb5 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -756,7 +756,7 @@ typedef struct { SArray* compactDetail; } SCompactObj; -// SGrantObj +// SGrantLogObj typedef enum { GRANT_STATE_INIT = 0, GRANT_STATE_UNGRANTED = 1, @@ -826,7 +826,7 @@ typedef struct { char* active; SArray* pMachines; // SGrantMachine SRWLatch lock; -} SGrantObj; +} SGrantLogObj; #ifdef __cplusplus } diff --git a/source/dnode/mnode/impl/inc/mndGrant.h b/source/dnode/mnode/impl/inc/mndGrant.h index 9ee97f69c3..a85d1f744c 100644 --- a/source/dnode/mnode/impl/inc/mndGrant.h +++ b/source/dnode/mnode/impl/inc/mndGrant.h @@ -30,21 +30,21 @@ void grantRestore(EGrantType grant, uint64_t value); #ifdef TD_ENTERPRISE - SSdbRaw *mndGrantActionEncode(SGrantObj * pGrant); + SSdbRaw *mndGrantActionEncode(SGrantLogObj * pGrant); SSdbRow *mndGrantActionDecode(SSdbRaw * pRaw); - int32_t mndGrantActionInsert(SSdb * pSdb, SGrantObj * pGrant); - int32_t mndGrantActionDelete(SSdb * pSdb, SGrantObj * pGrant); - int32_t mndGrantActionUpdate(SSdb * pSdb, SGrantObj * pOldGrant, SGrantObj * pNewGrant); + int32_t mndGrantActionInsert(SSdb * pSdb, SGrantLogObj * pGrant); + int32_t mndGrantActionDelete(SSdb * pSdb, SGrantLogObj * pGrant); + int32_t mndGrantActionUpdate(SSdb * pSdb, SGrantLogObj * pOldGrant, SGrantLogObj * pNewGrant); - int32_t grantAlterActiveCode(SMnode * pMnode, SGrantObj * pObj, const char *oldActive, const char *newActive, + int32_t grantAlterActiveCode(SMnode * pMnode, SGrantLogObj * pObj, const char *oldActive, const char *newActive, char **mergeActive); int32_t mndProcessConfigGrantReq(SMnode * pMnode, SRpcMsg * pReq, SMCfgClusterReq * pCfg); int32_t mndProcessUpdGrantLog(SMnode * pMnode, SRpcMsg * pReq, SArray * pMachines, SGrantState * pState); - int32_t mndGrantGetLastState(SMnode * pMnode, SGrantState * pState); - SGrantObj *mndAcquireGrant(SMnode * pMnode, void **ppIter); - void mndReleaseGrant(SMnode * pMnode, SGrantObj * pGrant, void *pIter); + int32_t mndGrantGetLastState(SMnode * pMnode, SGrantState * pState); + SGrantLogObj *mndAcquireGrant(SMnode * pMnode, void **ppIter); + void mndReleaseGrant(SMnode * pMnode, SGrantLogObj * pGrant, void *pIter); #endif #ifdef __cplusplus