Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b22986ce
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b22986ce
编写于
7月 06, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: support grant
上级
b2f7d70b
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
32 addition
and
5 deletion
+32
-5
include/common/tglobal.h
include/common/tglobal.h
+1
-0
include/common/tmsgdef.h
include/common/tmsgdef.h
+1
-0
source/common/src/tglobal.c
source/common/src/tglobal.c
+1
-0
source/dnode/mgmt/mgmt_dnode/inc/dmInt.h
source/dnode/mgmt/mgmt_dnode/inc/dmInt.h
+1
-0
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
+2
-1
source/dnode/mgmt/mgmt_dnode/src/dmWorker.c
source/dnode/mgmt/mgmt_dnode/src/dmWorker.c
+3
-0
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
+1
-1
source/dnode/mnode/impl/inc/mndDnode.h
source/dnode/mnode/impl/inc/mndDnode.h
+1
-0
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+1
-1
source/dnode/mnode/impl/src/mndGrant.c
source/dnode/mnode/impl/src/mndGrant.c
+4
-0
source/dnode/mnode/impl/src/mndMain.c
source/dnode/mnode/impl/src/mndMain.c
+14
-0
source/libs/catalog/src/ctgUtil.c
source/libs/catalog/src/ctgUtil.c
+2
-2
未找到文件。
include/common/tglobal.h
浏览文件 @
b22986ce
...
...
@@ -139,6 +139,7 @@ extern int32_t tsTransPullupInterval;
extern
int32_t
tsMqRebalanceInterval
;
extern
int32_t
tsTtlUnit
;
extern
int32_t
tsTtlPushInterval
;
extern
int32_t
tsGrantHBInterval
;
#define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize)
...
...
include/common/tmsgdef.h
浏览文件 @
b22986ce
...
...
@@ -149,6 +149,7 @@ enum {
TD_DEF_MSG_TYPE
(
TDMT_MND_TELEM_TIMER
,
"telem-tmr"
,
SMTimerReq
,
SMTimerReq
)
TD_DEF_MSG_TYPE
(
TDMT_MND_TRANS_TIMER
,
"trans-tmr"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_TTL_TIMER
,
"ttl-tmr"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_GRANT_HB_TIMER
,
"grant-hb-tmr"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_KILL_TRANS
,
"kill-trans"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_KILL_QUERY
,
"kill-query"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_MND_KILL_CONN
,
"kill-conn"
,
NULL
,
NULL
)
...
...
source/common/src/tglobal.c
浏览文件 @
b22986ce
...
...
@@ -189,6 +189,7 @@ int32_t tsTransPullupInterval = 2;
int32_t
tsMqRebalanceInterval
=
2
;
int32_t
tsTtlUnit
=
86400
;
int32_t
tsTtlPushInterval
=
60
;
int32_t
tsGrantHBInterval
=
1
;
void
taosAddDataDir
(
int32_t
index
,
char
*
v1
,
int32_t
level
,
int32_t
primary
)
{
...
...
source/dnode/mgmt/mgmt_dnode/inc/dmInt.h
浏览文件 @
b22986ce
...
...
@@ -46,6 +46,7 @@ int32_t dmProcessAuthRsp(SDnodeMgmt *pMgmt, SRpcMsg *pMsg);
int32_t
dmProcessGrantRsp
(
SDnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
int32_t
dmProcessServerRunStatus
(
SDnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
int32_t
dmProcessRetrieve
(
SDnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
int32_t
dmProcessGrantReq
(
SRpcMsg
*
pMsg
);
// dmWorker.c
int32_t
dmPutNodeMsgToMgmtQueue
(
SDnodeMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
...
...
source/dnode/mgmt/mgmt_dnode/src/dmHandle.c
浏览文件 @
b22986ce
...
...
@@ -331,7 +331,8 @@ SArray *dmGetMsgHandles() {
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_DND_SYSTABLE_RETRIEVE
,
dmPutNodeMsgToMgmtQueue
,
0
)
==
NULL
)
goto
_OVER
;
// Requests handled by MNODE
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_GRANT_RSP
,
dmPutNodeMsgToMgmtQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_GRANT
,
dmPutNodeMsgToMgmtQueue
,
0
)
==
NULL
)
goto
_OVER
;
// if (dmSetMgmtHandle(pArray, TDMT_MND_GRANT_RSP, dmPutNodeMsgToMgmtQueue, 0) == NULL) goto _OVER;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_AUTH_RSP
,
dmPutNodeMsgToMgmtQueue
,
0
)
==
NULL
)
goto
_OVER
;
code
=
0
;
...
...
source/dnode/mgmt/mgmt_dnode/src/dmWorker.c
浏览文件 @
b22986ce
...
...
@@ -144,6 +144,9 @@ static void dmProcessMgmtQueue(SQueueInfo *pInfo, SRpcMsg *pMsg) {
case
TDMT_DND_SYSTABLE_RETRIEVE
:
code
=
dmProcessRetrieve
(
pMgmt
,
pMsg
);
break
;
case
TDMT_MND_GRANT
:
code
=
dmProcessGrantReq
(
pMsg
);
break
;
default:
terrno
=
TSDB_CODE_MSG_NOT_PROCESSED
;
break
;
...
...
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
浏览文件 @
b22986ce
...
...
@@ -204,7 +204,7 @@ SArray *mmGetMsgHandles() {
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_HEARTBEAT
,
mmPutMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_STATUS
,
mmPutMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_SYSTABLE_RETRIEVE
,
mmPutMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_GRANT
,
mmPutMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
//
if (dmSetMgmtHandle(pArray, TDMT_MND_GRANT, mmPutMsgToWriteQueue, 0) == NULL) goto _OVER;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_AUTH
,
mmPutMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_SHOW_VARIABLES
,
mmPutMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_SERVER_VERSION
,
mmPutMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
...
...
source/dnode/mnode/impl/inc/mndDnode.h
浏览文件 @
b22986ce
...
...
@@ -29,6 +29,7 @@ void mndReleaseDnode(SMnode *pMnode, SDnodeObj *pDnode);
SEpSet
mndGetDnodeEpset
(
SDnodeObj
*
pDnode
);
int32_t
mndGetDnodeSize
(
SMnode
*
pMnode
);
bool
mndIsDnodeOnline
(
SDnodeObj
*
pDnode
,
int64_t
curMs
);
void
mndGetDnodeData
(
SMnode
*
pMnode
,
SArray
*
pDnodeEps
);
#ifdef __cplusplus
}
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
b22986ce
...
...
@@ -262,7 +262,7 @@ bool mndIsDnodeOnline(SDnodeObj *pDnode, int64_t curMs) {
return
true
;
}
static
void
mndGetDnodeData
(
SMnode
*
pMnode
,
SArray
*
pDnodeEps
)
{
void
mndGetDnodeData
(
SMnode
*
pMnode
,
SArray
*
pDnodeEps
)
{
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfEps
=
0
;
...
...
source/dnode/mnode/impl/src/mndGrant.c
浏览文件 @
b22986ce
...
...
@@ -118,8 +118,11 @@ static int32_t mndRetrieveGrant(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl
return
numOfRows
;
}
static
int32_t
mndProcessGrantHB
(
SRpcMsg
*
pReq
)
{
return
TSDB_CODE_SUCCESS
;
}
int32_t
mndInitGrant
(
SMnode
*
pMnode
)
{
mndAddShowRetrieveHandle
(
pMnode
,
TSDB_MGMT_TABLE_GRANTS
,
mndRetrieveGrant
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_GRANT_HB_TIMER
,
mndProcessGrantHB
);
return
0
;
}
...
...
@@ -129,6 +132,7 @@ int32_t grantCheck(EGrantType grant) { return TSDB_CODE_SUCCESS; }
void
grantReset
(
EGrantType
grant
,
uint64_t
value
)
{}
void
grantAdd
(
EGrantType
grant
,
uint64_t
value
)
{}
void
grantRestore
(
EGrantType
grant
,
uint64_t
value
)
{}
int32_t
dmProcessGrantReq
(
SRpcMsg
*
pMsg
)
{
return
TSDB_CODE_SUCCESS
;
}
#endif
...
...
source/dnode/mnode/impl/src/mndMain.c
浏览文件 @
b22986ce
...
...
@@ -90,6 +90,16 @@ static void mndPullupTelem(SMnode *pMnode) {
}
}
static
void
mndGrantHeartBeat
(
SMnode
*
pMnode
)
{
int32_t
contLen
=
0
;
void
*
pReq
=
mndBuildTimerMsg
(
&
contLen
);
if
(
pReq
!=
NULL
)
{
SRpcMsg
rpcMsg
=
{
.
msgType
=
TDMT_MND_GRANT_HB_TIMER
,
.
pCont
=
pReq
,
.
contLen
=
contLen
,
.
info
.
ahandle
=
(
void
*
)
0x9527
};
tmsgPutToQueue
(
&
pMnode
->
msgCb
,
READ_QUEUE
,
&
rpcMsg
);
}
}
static
void
*
mndThreadFp
(
void
*
param
)
{
SMnode
*
pMnode
=
param
;
int64_t
lastTime
=
0
;
...
...
@@ -115,6 +125,10 @@ static void *mndThreadFp(void *param) {
if
(
lastTime
%
(
tsTelemInterval
*
10
)
==
0
)
{
mndPullupTelem
(
pMnode
);
}
if
(
lastTime
%
(
tsGrantHBInterval
*
10
)
==
0
)
{
mndGrantHeartBeat
(
pMnode
);
}
}
return
NULL
;
...
...
source/libs/catalog/src/ctgUtil.c
浏览文件 @
b22986ce
...
...
@@ -271,7 +271,7 @@ void ctgFreeHandle(SCatalog* pCtg) {
taosMemoryFree
(
pCtg
);
ctgInfo
(
"handle freed, c
ul
sterId:0x%"
PRIx64
,
clusterId
);
ctgInfo
(
"handle freed, c
lu
sterId:0x%"
PRIx64
,
clusterId
);
}
void
ctgClearHandle
(
SCatalog
*
pCtg
)
{
...
...
@@ -302,7 +302,7 @@ void ctgClearHandle(SCatalog* pCtg) {
CTG_CACHE_STAT_INC
(
numOfClear
,
1
);
ctgInfo
(
"handle cleared, c
ul
sterId:0x%"
PRIx64
,
clusterId
);
ctgInfo
(
"handle cleared, c
lu
sterId:0x%"
PRIx64
,
clusterId
);
}
void
ctgFreeSUseDbOutput
(
SUseDbOutput
*
pOutput
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录