Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
ed596901
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
ed596901
编写于
4月 04, 2020
作者:
S
slguan
提交者:
GitHub
4月 04, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1516 from taosdata/refactor/cluster
Refactor/cluster
上级
d43b3eb9
1346d937
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
219 addition
and
277 deletion
+219
-277
src/mnode/src/mgmtMnode.c
src/mnode/src/mgmtMnode.c
+2
-2
src/mnode/src/mgmtShell.c
src/mnode/src/mgmtShell.c
+24
-30
src/mnode/src/mgmtTable.c
src/mnode/src/mgmtTable.c
+181
-245
tests/script/basicSuite.sim
tests/script/basicSuite.sim
+12
-0
未找到文件。
src/mnode/src/mgmtMnode.c
浏览文件 @
ed596901
...
...
@@ -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
浏览文件 @
ed596901
...
...
@@ -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
)
{
SCMTableInfoMsg
*
pInfo
=
(
SCMTableInfoMsg
*
)
pMsg
;
int16_t
autoCreate
=
htons
(
pInfo
->
createFlag
);
STableInfo
*
pTable
=
mgmtGetTable
(
pInfo
->
tableId
)
;
static
bool
mgmtCheck
TableMetaMsgReadOnly
(
SQueuedMsg
*
pMsg
)
{
SCMTableInfoMsg
*
pInfo
=
pMsg
->
pCont
;
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
浏览文件 @
ed596901
此差异已折叠。
点击以展开。
tests/script/basicSuite.sim
浏览文件 @
ed596901
#################################
run general/user/basic1.sim
run general/show/dnodes.sim
run general/db/basic1.sim
run general/db/basic2.sim
run general/db/basic3.sim
run general/db/basic4.sim
run general/db/basic5.sim
run general/table/basic1.sim
run general/table/basic2.sim
run general/table/basic3.sim
##################################
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录