minor changes
This commit is contained in:
parent
43f7e18c65
commit
69ca3783ef
|
@ -759,6 +759,9 @@ typedef struct {
|
|||
SReplica replicas[TSDB_MAX_REPLICA];
|
||||
} SCreateVnodeReq, SAlterVnodeReq;
|
||||
|
||||
int32_t tSerializeSCreateVnodeReq(void* buf, int32_t bufLen, SCreateVnodeReq* pReq);
|
||||
int32_t tDeserializeSCreateVnodeReq(void* buf, int32_t bufLen, SCreateVnodeReq* pReq);
|
||||
|
||||
typedef struct {
|
||||
int32_t vgId;
|
||||
int32_t dnodeId;
|
||||
|
@ -766,10 +769,8 @@ typedef struct {
|
|||
char db[TSDB_DB_FNAME_LEN];
|
||||
} SDropVnodeReq, SSyncVnodeReq, SCompactVnodeReq;
|
||||
|
||||
typedef struct {
|
||||
int32_t vgId;
|
||||
int8_t accessState;
|
||||
} SAuthVnodeReq;
|
||||
int32_t tSerializeSDropVnodeReq(void* buf, int32_t bufLen, SDropVnodeReq* pReq);
|
||||
int32_t tDeserializeSDropVnodeReq(void* buf, int32_t bufLen, SDropVnodeReq* pReq);
|
||||
|
||||
typedef struct {
|
||||
SMsgHead header;
|
||||
|
|
|
@ -82,7 +82,6 @@ enum {
|
|||
TD_DEF_MSG_TYPE(TDMT_DND_CREATE_VNODE, "dnode-create-vnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_ALTER_VNODE, "dnode-alter-vnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_DROP_VNODE, "dnode-drop-vnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_AUTH_VNODE, "dnode-auth-vnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_SYNC_VNODE, "dnode-sync-vnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_COMPACT_VNODE, "dnode-compact-vnode", NULL, NULL)
|
||||
TD_DEF_MSG_TYPE(TDMT_DND_CONFIG_DNODE, "dnode-config-dnode", NULL, NULL)
|
||||
|
|
|
@ -1984,7 +1984,7 @@ int32_t tDeserializeSConnectRsp(void *buf, int32_t bufLen, SConnectRsp *pRsp) {
|
|||
|
||||
if (tStartDecode(&decoder) < 0) return -1;
|
||||
if (tDecodeI32(&decoder, &pRsp->acctId) < 0) return -1;
|
||||
if (tDecodeI64(&decoder, &pRsp->clusterId) < 0) return -1;
|
||||
if (tDecodeI64(&decoder, &pRsp->clusterId) < 0) return -1;
|
||||
if (tDecodeI32(&decoder, &pRsp->connId) < 0) return -1;
|
||||
if (tDecodeI8(&decoder, &pRsp->superUser) < 0) return -1;
|
||||
if (tDecodeSEpSet(&decoder, &pRsp->epSet) < 0) return -1;
|
||||
|
|
|
@ -652,9 +652,6 @@ static void dndProcessMgmtQueue(SDnode *pDnode, SRpcMsg *pMsg) {
|
|||
case TDMT_DND_DROP_VNODE:
|
||||
code = dndProcessDropVnodeReq(pDnode, pMsg);
|
||||
break;
|
||||
case TDMT_DND_AUTH_VNODE:
|
||||
code = dndProcessAuthVnodeReq(pDnode, pMsg);
|
||||
break;
|
||||
case TDMT_DND_SYNC_VNODE:
|
||||
code = dndProcessSyncVnodeReq(pDnode, pMsg);
|
||||
break;
|
||||
|
|
|
@ -57,8 +57,6 @@ static void dndInitMsgFp(STransMgmt *pMgmt) {
|
|||
pMgmt->msgFp[TMSG_INDEX(TDMT_DND_DROP_VNODE_RSP)] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TMSG_INDEX(TDMT_DND_SYNC_VNODE)] = dndProcessMgmtMsg;
|
||||
pMgmt->msgFp[TMSG_INDEX(TDMT_DND_SYNC_VNODE_RSP)] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TMSG_INDEX(TDMT_DND_AUTH_VNODE)] = dndProcessMgmtMsg;
|
||||
pMgmt->msgFp[TMSG_INDEX(TDMT_DND_AUTH_VNODE_RSP)] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TMSG_INDEX(TDMT_DND_COMPACT_VNODE)] = dndProcessMgmtMsg;
|
||||
pMgmt->msgFp[TMSG_INDEX(TDMT_DND_COMPACT_VNODE_RSP)] = dndProcessMnodeWriteMsg;
|
||||
pMgmt->msgFp[TMSG_INDEX(TDMT_DND_CONFIG_DNODE)] = dndProcessMgmtMsg;
|
||||
|
|
|
@ -562,12 +562,6 @@ static SDropVnodeReq *dndParseDropVnodeReq(SRpcMsg *pReq) {
|
|||
return pDrop;
|
||||
}
|
||||
|
||||
static SAuthVnodeReq *dndParseAuthVnodeReq(SRpcMsg *pReq) {
|
||||
SAuthVnodeReq *pAuth = pReq->pCont;
|
||||
pAuth->vgId = htonl(pAuth->vgId);
|
||||
return pAuth;
|
||||
}
|
||||
|
||||
int32_t dndProcessCreateVnodeReq(SDnode *pDnode, SRpcMsg *pReq) {
|
||||
SCreateVnodeReq *pCreate = dndParseCreateVnodeReq(pReq);
|
||||
dDebug("vgId:%d, create vnode req is received", pCreate->vgId);
|
||||
|
@ -683,23 +677,6 @@ int32_t dndProcessDropVnodeReq(SDnode *pDnode, SRpcMsg *pReq) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int32_t dndProcessAuthVnodeReq(SDnode *pDnode, SRpcMsg *pReq) {
|
||||
SAuthVnodeReq *pAuth = (SAuthVnodeReq *)dndParseAuthVnodeReq(pReq);
|
||||
|
||||
int32_t vgId = pAuth->vgId;
|
||||
dDebug("vgId:%d, auth vnode req is received", vgId);
|
||||
|
||||
SVnodeObj *pVnode = dndAcquireVnode(pDnode, vgId);
|
||||
if (pVnode == NULL) {
|
||||
dDebug("vgId:%d, failed to auth since %s", vgId, terrstr());
|
||||
return -1;
|
||||
}
|
||||
|
||||
pVnode->accessState = pAuth->accessState;
|
||||
dndReleaseVnode(pDnode, pVnode);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t dndProcessSyncVnodeReq(SDnode *pDnode, SRpcMsg *pReq) {
|
||||
SSyncVnodeReq *pSync = (SSyncVnodeReq *)dndParseDropVnodeReq(pReq);
|
||||
|
||||
|
|
Loading…
Reference in New Issue