Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b58f9459
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b58f9459
编写于
4月 04, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-17]
上级
036b3d35
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
206 addition
and
276 deletion
+206
-276
src/mnode/src/mgmtMnode.c
src/mnode/src/mgmtMnode.c
+2
-2
src/mnode/src/mgmtShell.c
src/mnode/src/mgmtShell.c
+23
-29
src/mnode/src/mgmtTable.c
src/mnode/src/mgmtTable.c
+181
-245
未找到文件。
src/mnode/src/mgmtMnode.c
浏览文件 @
b58f9459
...
...
@@ -48,7 +48,7 @@ int32_t mgmtInitMnodes() {
void
mgmtCleanupMnodes
()
{}
bool
mgmtInServerStatus
()
{
return
tsMnodeObj
.
status
==
TSDB_MN_STATUS_SERVING
;
}
bool
mgmtIsMaster
()
{
return
tsMnodeObj
.
role
==
TSDB_MN_ROLE_MASTER
;
}
bool
mgmtCheckRedirect
(
void
*
handle
)
{
return
false
;
}
bool
mgmtCheckRedirect
(
void
*
t
handle
)
{
return
false
;
}
static
int32_t
mgmtGetMnodesNum
()
{
return
1
;
...
...
@@ -117,7 +117,7 @@ static int32_t mgmtGetMnodeMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pCo
pShow
->
offset
[
i
]
=
pShow
->
offset
[
i
-
1
]
+
pShow
->
bytes
[
i
-
1
];
}
pShow
->
numOfRows
=
mgmtGet
D
nodesNum
();
pShow
->
numOfRows
=
mgmtGet
M
nodesNum
();
pShow
->
rowSize
=
pShow
->
offset
[
cols
-
1
]
+
pShow
->
bytes
[
cols
-
1
];
pShow
->
pNode
=
NULL
;
...
...
src/mnode/src/mgmtShell.c
浏览文件 @
b58f9459
...
...
@@ -40,7 +40,7 @@ typedef int32_t (*SShowMetaFp)(STableMetaMsg *pMeta, SShowObj *pShow, void *pCon
typedef
int32_t
(
*
SShowRetrieveFp
)(
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
,
void
*
pConn
);
static
int
mgmtShellRetriveAuth
(
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
);
static
bool
mgmtCheckMsgReadOnly
(
int8_t
type
,
void
*
pCont
);
static
bool
mgmtCheckMsgReadOnly
(
SQueuedMsg
*
pMsg
);
static
void
mgmtProcessMsgFromShell
(
SRpcMsg
*
pMsg
);
static
void
mgmtProcessUnSupportMsg
(
SRpcMsg
*
rpcMsg
);
static
void
mgmtProcessMsgWhileNotReady
(
SRpcMsg
*
rpcMsg
);
...
...
@@ -135,7 +135,7 @@ static void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) {
}
if
(
mgmtCheckRedirect
(
rpcMsg
->
handle
))
{
//
send resp in redirect func
//
rpcSendRedirectRsp(rpcMsg->handle, mgmtGetMnodeIpListForRedirect());
rpcFreeCont
(
rpcMsg
->
pCont
);
return
;
}
...
...
@@ -165,7 +165,7 @@ static void mgmtProcessMsgFromShell(SRpcMsg *rpcMsg) {
return
;
}
if
(
mgmtCheckMsgReadOnly
(
rpcMsg
->
msgType
,
rpcMsg
->
pCont
))
{
if
(
mgmtCheckMsgReadOnly
(
pMsg
))
{
(
*
tsMgmtProcessShellMsgFp
[
rpcMsg
->
msgType
])(
pMsg
);
mgmtFreeQueuedMsg
(
pMsg
);
}
else
{
...
...
@@ -185,7 +185,7 @@ static void mgmtProcessShowMsg(SQueuedMsg *pMsg) {
return
;
}
if
(
!
tsMgmtShowMetaFp
[
pShowMsg
->
type
])
{
if
(
!
tsMgmtShowMetaFp
[
pShowMsg
->
type
]
||
!
tsMgmtShowRetrieveFp
[
pShowMsg
->
type
]
)
{
mError
(
"show type:%s is not support"
,
taosGetShowTypeStr
(
pShowMsg
->
type
));
mgmtSendSimpleResp
(
pMsg
->
thandle
,
TSDB_CODE_OPS_NOT_SUPPORT
);
return
;
...
...
@@ -299,22 +299,13 @@ static void mgmtProcessRetrieveMsg(SQueuedMsg *pMsg) {
}
static
void
mgmtProcessHeartBeatMsg
(
SQueuedMsg
*
pMsg
)
{
//SCMHeartBeatMsg *pHBMsg = (SCMHeartBeatMsg *) rpcMsg->pCont;
//mgmtSaveQueryStreamList(pHBMsg);
SCMHeartBeatRsp
*
pHBRsp
=
(
SCMHeartBeatRsp
*
)
rpcMallocCont
(
sizeof
(
SCMHeartBeatRsp
));
if
(
pHBRsp
==
NULL
)
{
mgmtSendSimpleResp
(
pMsg
->
thandle
,
TSDB_CODE_SERV_OUT_OF_MEMORY
);
return
;
}
SRpcConnInfo
connInfo
;
if
(
rpcGetConnInfo
(
pMsg
->
thandle
,
&
connInfo
)
!=
0
)
{
mError
(
"conn:%p is already released while process heart beat msg"
,
pMsg
->
thandle
);
return
;
}
if
(
connInfo
.
serverIp
==
tsPublicIpInt
)
{
if
(
pMsg
->
usePublicIp
)
{
mgmtGetMnodePublicIpList
(
&
pHBRsp
->
ipList
);
}
else
{
mgmtGetMnodePrivateIpList
(
&
pHBRsp
->
ipList
);
...
...
@@ -424,10 +415,10 @@ static void mgmtProcessUseMsg(SQueuedMsg *pMsg) {
SCMUseDbMsg
*
pUseDbMsg
=
pMsg
->
pCont
;
// todo check for priority of current user
SDbObj
*
pDbObj
=
mgmtGetDb
(
pUseDbMsg
->
db
);
pMsg
->
pDb
=
mgmtGetDb
(
pUseDbMsg
->
db
);
int32_t
code
=
TSDB_CODE_SUCCESS
;
if
(
p
DbObj
==
NULL
)
{
if
(
p
Msg
->
pDb
==
NULL
)
{
code
=
TSDB_CODE_INVALID_DB
;
}
...
...
@@ -438,26 +429,29 @@ static void mgmtProcessUseMsg(SQueuedMsg *pMsg) {
/**
* check if we need to add mgmtProcessTableMetaMsg into tranQueue, which will be executed one-by-one.
*/
static
bool
mgmtCheck
MeterMetaMsgType
(
void
*
pMsg
)
{
static
bool
mgmtCheck
TableMetaMsgReadOnly
(
SQueuedMsg
*
pMsg
)
{
SCMTableInfoMsg
*
pInfo
=
(
SCMTableInfoMsg
*
)
pMsg
;
int16_t
autoCreate
=
htons
(
pInfo
->
createFlag
);
STableInfo
*
pTable
=
mgmtGetTable
(
pInfo
->
tableId
)
;
pMsg
->
pTable
=
mgmtGetTable
(
pInfo
->
tableId
);
if
(
pMsg
->
pTable
!=
NULL
)
return
true
;
// If table does not exists and autoCreate flag is set, we add the handler into task queue
bool
addIntoTranQueue
=
(
pTable
==
NULL
&&
autoCreate
==
1
);
if
(
a
ddIntoTranQueue
)
{
int16_t
autoCreate
=
htons
(
pInfo
->
createFlag
);
if
(
a
utoCreate
==
1
)
{
mTrace
(
"table:%s auto created task added"
,
pInfo
->
tableId
);
return
false
;
}
mgmtDecTableRef
(
pTable
);
return
addIntoTranQueue
;
return
true
;
}
static
bool
mgmtCheckMsgReadOnly
(
int8_t
type
,
void
*
pCont
)
{
if
((
type
==
TSDB_MSG_TYPE_CM_TABLE_META
&&
(
!
mgmtCheckMeterMetaMsgType
(
pCont
)))
||
type
==
TSDB_MSG_TYPE_CM_STABLE_VGROUP
||
type
==
TSDB_MSG_TYPE_RETRIEVE
||
type
==
TSDB_MSG_TYPE_CM_SHOW
||
type
==
TSDB_MSG_TYPE_CM_TABLES_META
||
type
==
TSDB_MSG_TYPE_CM_CONNECT
)
{
static
bool
mgmtCheckMsgReadOnly
(
SQueuedMsg
*
pMsg
)
{
if
(
pMsg
->
msgType
==
TSDB_MSG_TYPE_CM_TABLE_META
)
{
return
mgmtCheckTableMetaMsgReadOnly
(
pMsg
);
}
if
(
pMsg
->
msgType
==
TSDB_MSG_TYPE_CM_STABLE_VGROUP
||
pMsg
->
msgType
==
TSDB_MSG_TYPE_RETRIEVE
||
pMsg
->
msgType
==
TSDB_MSG_TYPE_CM_SHOW
||
pMsg
->
msgType
==
TSDB_MSG_TYPE_CM_TABLES_META
||
pMsg
->
msgType
==
TSDB_MSG_TYPE_CM_CONNECT
)
{
return
true
;
}
...
...
src/mnode/src/mgmtTable.c
浏览文件 @
b58f9459
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录