Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
d255b599
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看板
提交
d255b599
编写于
4月 16, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change table meta
上级
de76b5bd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
23 deletion
+25
-23
src/inc/taosmsg.h
src/inc/taosmsg.h
+13
-15
src/mnode/src/mgmtTable.c
src/mnode/src/mgmtTable.c
+12
-8
未找到文件。
src/inc/taosmsg.h
浏览文件 @
d255b599
...
...
@@ -635,6 +635,7 @@ typedef struct SCMSTableVgroupMsg {
typedef
struct
{
int32_t
vgId
;
int8_t
numOfIps
;
SIpAddr
ipAddr
[
TSDB_REPLICA_MAX_NUM
];
}
SCMVgroupInfo
;
...
...
@@ -687,21 +688,18 @@ typedef struct {
}
SSuperTableMeta
;
typedef
struct
STableMetaMsg
{
int32_t
contLen
;
char
tableId
[
TSDB_TABLE_ID_LEN
];
// table id
char
stableId
[
TSDB_TABLE_ID_LEN
];
// stable name if it is created according to super table
uint8_t
numOfTags
;
uint8_t
precision
;
uint8_t
tableType
;
int16_t
numOfColumns
;
int16_t
sversion
;
int8_t
numOfVpeers
;
SVnodeDesc
vpeerDesc
[
TSDB_VNODES_SUPPORT
];
int32_t
sid
;
int32_t
vgId
;
uint64_t
uid
;
SSchema
schema
[];
int32_t
contLen
;
char
tableId
[
TSDB_TABLE_ID_LEN
];
// table id
char
stableId
[
TSDB_TABLE_ID_LEN
];
// stable name if it is created according to super table
uint8_t
numOfTags
;
uint8_t
precision
;
uint8_t
tableType
;
int16_t
numOfColumns
;
int16_t
sversion
;
int32_t
sid
;
uint64_t
uid
;
SCMVgroupInfo
vgroup
;
SSchema
schema
[];
}
STableMetaMsg
;
typedef
struct
SMultiTableMeta
{
...
...
src/mnode/src/mgmtTable.c
浏览文件 @
d255b599
...
...
@@ -1168,7 +1168,7 @@ static void mgmtProcessSuperTableVgroupMsg(SQueuedMsg *pMsg) {
SCMSTableVgroupMsg
*
pInfo
=
pMsg
->
pCont
;
SSuperTableObj
*
pTable
=
mgmtGetSuperTable
(
pInfo
->
tableId
);
pMsg
->
pTable
=
pTable
;
pMsg
->
pTable
=
(
STableObj
*
)
pTable
;
if
(
pMsg
->
pTable
==
NULL
)
{
mgmtSendSimpleResp
(
pMsg
->
thandle
,
TSDB_CODE_INVALID_TABLE
);
return
;
...
...
@@ -1196,6 +1196,7 @@ static void mgmtProcessSuperTableVgroupMsg(SQueuedMsg *pMsg) {
pRsp
->
vgroups
[
vg
].
ipAddr
[
vn
].
ip
=
htonl
(
pDnode
->
privateIp
);
pRsp
->
vgroups
[
vg
].
ipAddr
[
vn
].
port
=
htons
(
tsDnodeShellPort
);
pRsp
->
vgroups
[
vg
].
numOfIps
++
;
clusterReleaseDnode
(
pDnode
);
}
...
...
@@ -1575,7 +1576,6 @@ static int32_t mgmtDoGetChildTableMeta(SQueuedMsg *pMsg, STableMetaMsg *pMeta) {
pMeta
->
uid
=
htobe64
(
pTable
->
uid
);
pMeta
->
sid
=
htonl
(
pTable
->
sid
);
pMeta
->
vgId
=
htonl
(
pTable
->
vgId
);
pMeta
->
precision
=
pDb
->
cfg
.
precision
;
pMeta
->
tableType
=
pTable
->
info
.
type
;
strncpy
(
pMeta
->
tableId
,
pTable
->
info
.
tableId
,
tListLen
(
pTable
->
info
.
tableId
));
...
...
@@ -1599,16 +1599,20 @@ static int32_t mgmtDoGetChildTableMeta(SQueuedMsg *pMsg, STableMetaMsg *pMeta) {
return
TSDB_CODE_INVALID_VGROUP_ID
;
}
for
(
int32_t
i
=
0
;
i
<
TSDB_VNODES_SUPPORT
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
SDnodeObj
*
pDnode
=
clusterGetDnode
(
pVgroup
->
vnodeGid
[
i
].
dnodeId
);
if
(
pDnode
==
NULL
)
break
;
if
(
usePublicIp
)
{
pMeta
->
vpeerDesc
[
i
].
ip
=
htonl
(
pVgroup
->
vnodeGid
[
i
].
publicIp
);
pMeta
->
vgroup
.
ipAddr
[
i
].
ip
=
htonl
(
pDnode
->
publicIp
);
pMeta
->
vgroup
.
ipAddr
[
i
].
port
=
htonl
(
tsDnodeShellPort
);
}
else
{
pMeta
->
vpeerDesc
[
i
].
ip
=
htonl
(
pVgroup
->
vnodeGid
[
i
].
privateIp
);
pMeta
->
vgroup
.
ipAddr
[
i
].
ip
=
htonl
(
pDnode
->
privateIp
);
pMeta
->
vgroup
.
ipAddr
[
i
].
port
=
htonl
(
tsDnodeShellPort
);
}
// pMeta->vpeerDesc[i].vgId = htonl(pVgroup->vgId)
;
pMeta
->
vpeerDesc
[
i
].
dnodeId
=
htonl
(
pVgroup
->
vnodeGid
[
i
].
dnodeId
);
pMeta
->
vgroup
.
numOfIps
++
;
clusterReleaseDnode
(
pDnode
);
}
pMeta
->
numOfVpeers
=
pVgroup
->
numOfVnodes
;
pMeta
->
vgroup
.
vgId
=
htonl
(
pVgroup
->
vgId
)
;
mTrace
(
"table:%s, uid:%"
PRIu64
" table meta is retrieved"
,
pTable
->
info
.
tableId
,
pTable
->
uid
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录