Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
~笨蛋陪你哭
TDengine
提交
116a5b04
T
TDengine
项目概览
~笨蛋陪你哭
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
116a5b04
编写于
5月 29, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add config table message
上级
2f0d82ca
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
58 addition
and
32 deletion
+58
-32
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+38
-0
src/inc/dnode.h
src/inc/dnode.h
+4
-3
src/inc/taosmsg.h
src/inc/taosmsg.h
+3
-3
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+13
-26
未找到文件。
src/dnode/src/dnodeShell.c
浏览文件 @
116a5b04
...
...
@@ -168,6 +168,44 @@ static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char
return
rpcRsp
.
code
;
}
void
*
dnodeSendCfgTableToRecv
(
int32_t
vgId
,
int32_t
sid
)
{
dTrace
(
"vgId:%d, sid:%d send config table msg to mnode"
,
vgId
,
sid
);
int32_t
contLen
=
sizeof
(
SDMConfigTableMsg
);
SDMConfigTableMsg
*
pMsg
=
rpcMallocCont
(
contLen
);
pMsg
->
dnodeId
=
htonl
(
dnodeGetDnodeId
());
pMsg
->
vgId
=
htonl
(
vgId
);
pMsg
->
sid
=
htonl
(
sid
);
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pMsg
;
rpcMsg
.
contLen
=
contLen
;
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_DM_CONFIG_TABLE
;
SRpcMsg
rpcRsp
=
{
0
};
dnodeSendMsgToDnodeRecv
(
&
rpcMsg
,
&
rpcRsp
);
terrno
=
rpcRsp
.
code
;
if
(
rpcRsp
.
code
!=
0
)
{
rpcFreeCont
(
rpcRsp
.
pCont
);
dError
(
"vgId:%d, sid:%d failed to config table from mnode"
,
vgId
,
sid
);
return
NULL
;
}
else
{
dPrint
(
"vgId:%d, sid:%d config table msg is received"
,
vgId
,
sid
);
// delete this after debug finished
SMDCreateTableMsg
*
pTable
=
rpcRsp
.
pCont
;
int16_t
numOfColumns
=
htons
(
pTable
->
numOfColumns
);
int16_t
numOfTags
=
htons
(
pTable
->
numOfTags
);
int32_t
sid
=
htonl
(
pTable
->
sid
);
uint64_t
uid
=
htobe64
(
pTable
->
uid
);
dPrint
(
"table:%s, numOfColumns:%d numOfTags:%d sid:%d uid:%d"
,
pTable
->
tableId
,
numOfColumns
,
numOfTags
,
sid
,
uid
);
return
rpcRsp
.
pCont
;
}
}
SDnodeStatisInfo
dnodeGetStatisInfo
()
{
SDnodeStatisInfo
info
=
{
0
};
if
(
dnodeGetRunStatus
()
==
TSDB_DNODE_RUN_STATUS_RUNING
)
{
...
...
src/inc/dnode.h
浏览文件 @
116a5b04
...
...
@@ -44,9 +44,10 @@ void dnodeGetMnodeIpSetForShell(void *ipSet);
void
*
dnodeGetMnodeInfos
();
int32_t
dnodeGetDnodeId
();
void
dnodeAddClientRspHandle
(
uint8_t
msgType
,
void
(
*
fp
)(
SRpcMsg
*
rpcMsg
));
void
dnodeSendMsgToDnode
(
SRpcIpSet
*
ipSet
,
SRpcMsg
*
rpcMsg
);
void
dnodeSendMsgToDnodeRecv
(
SRpcMsg
*
rpcMsg
,
SRpcMsg
*
rpcRsp
);
void
dnodeAddClientRspHandle
(
uint8_t
msgType
,
void
(
*
fp
)(
SRpcMsg
*
rpcMsg
));
void
dnodeSendMsgToDnode
(
SRpcIpSet
*
ipSet
,
SRpcMsg
*
rpcMsg
);
void
dnodeSendMsgToDnodeRecv
(
SRpcMsg
*
rpcMsg
,
SRpcMsg
*
rpcRsp
);
void
*
dnodeSendCfgTableToRecv
(
int32_t
vgId
,
int32_t
sid
);
void
*
dnodeAllocateVnodeWqueue
(
void
*
pVnode
);
void
dnodeFreeVnodeWqueue
(
void
*
queue
);
...
...
src/inc/taosmsg.h
浏览文件 @
116a5b04
...
...
@@ -676,9 +676,9 @@ typedef struct {
}
SCMCreateDnodeMsg
,
SCMDropDnodeMsg
;
typedef
struct
{
uint32_t
dnode
;
int32_t
vnode
;
int32_t
sid
;
int32_t
dnodeId
;
int32_t
vgId
;
int32_t
sid
;
}
SDMConfigTableMsg
;
typedef
struct
{
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
116a5b04
...
...
@@ -1877,38 +1877,25 @@ static SChildTableObj* mnodeGetTableByPos(int32_t vnode, int32_t sid) {
static
int32_t
mnodeProcessTableCfgMsg
(
SMnodeMsg
*
pMsg
)
{
SDMConfigTableMsg
*
pCfg
=
pMsg
->
rpcMsg
.
pCont
;
pCfg
->
dnode
=
htonl
(
pCfg
->
dnode
);
pCfg
->
v
node
=
htonl
(
pCfg
->
vnode
);
pCfg
->
sid
=
htonl
(
pCfg
->
sid
);
mTrace
(
"dnode:%
s, vnode:%d, sid:%d, receive table config msg"
,
taosIpStr
(
pCfg
->
dnode
),
pCfg
->
vnode
,
pCfg
->
sid
);
pCfg
->
dnode
Id
=
htonl
(
pCfg
->
dnodeId
);
pCfg
->
v
gId
=
htonl
(
pCfg
->
vgId
);
pCfg
->
sid
=
htonl
(
pCfg
->
sid
);
mTrace
(
"dnode:%
d, vgId:%d sid:%d, receive table config msg"
,
pCfg
->
dnodeId
,
pCfg
->
vgId
,
pCfg
->
sid
);
SChildTableObj
*
pTable
=
mnodeGetTableByPos
(
pCfg
->
v
node
,
pCfg
->
sid
);
SChildTableObj
*
pTable
=
mnodeGetTableByPos
(
pCfg
->
v
gId
,
pCfg
->
sid
);
if
(
pTable
==
NULL
)
{
mError
(
"dnode:%
s, vnode:%d, sid:%d, table not found"
,
taosIpStr
(
pCfg
->
dnode
),
pCfg
->
vnode
,
pCfg
->
sid
);
mError
(
"dnode:%
d, vgId:%d sid:%d, table not found"
,
pCfg
->
dnodeId
,
pCfg
->
vgId
,
pCfg
->
sid
);
return
TSDB_CODE_NOT_ACTIVE_TABLE
;
}
SMDCreateTableMsg
*
pMDCreate
=
NULL
;
pMDCreate
=
mnodeBuildCreateChildTableMsg
(
NULL
,
(
SChildTableObj
*
)
pTable
);
if
(
pMDCreate
==
NULL
)
{
mnodeDecTableRef
(
pTable
);
return
terrno
;
}
SDnodeObj
*
pDnode
=
mnodeGetDnode
(
pCfg
->
dnode
);
SRpcIpSet
ipSet
=
mnodeGetIpSetFromIp
(
pDnode
->
dnodeEp
);
SRpcMsg
rpcRsp
=
{
.
handle
=
NULL
,
.
pCont
=
pMDCreate
,
.
contLen
=
htonl
(
pMDCreate
->
contLen
),
.
code
=
0
,
.
msgType
=
TSDB_MSG_TYPE_MD_CREATE_TABLE
};
dnodeSendMsgToDnode
(
&
ipSet
,
&
rpcRsp
);
SMDCreateTableMsg
*
pCreate
=
NULL
;
pCreate
=
mnodeBuildCreateChildTableMsg
(
NULL
,
(
SChildTableObj
*
)
pTable
);
mnodeDecTableRef
(
pTable
);
mnodeDecDnodeRef
(
pDnode
);
if
(
pCreate
==
NULL
)
return
terrno
;
pMsg
->
rpcRsp
.
rsp
=
pCreate
;
pMsg
->
rpcRsp
.
len
=
htonl
(
pCreate
->
contLen
);
return
TSDB_CODE_SUCCESS
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录