Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6eb29bf2
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看板
提交
6eb29bf2
编写于
5月 29, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-4385] fix bug found by regression test.
上级
ebd919bc
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
28 addition
and
19 deletion
+28
-19
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+28
-19
未找到文件。
src/mnode/src/mnodeTable.c
浏览文件 @
6eb29bf2
...
@@ -2860,7 +2860,7 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
...
@@ -2860,7 +2860,7 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
if
(
num
!=
pInfo
->
numOfTables
+
pInfo
->
numOfVgroups
)
{
if
(
num
!=
pInfo
->
numOfTables
+
pInfo
->
numOfVgroups
)
{
mError
(
"msg:%p, app:%p, failed to get multi-tableMeta, msg inconsistent"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
);
mError
(
"msg:%p, app:%p, failed to get multi-tableMeta, msg inconsistent"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
);
code
=
TSDB_CODE_MND_INVALID_TABLE_NAME
;
code
=
TSDB_CODE_MND_INVALID_TABLE_NAME
;
goto
_e
rror
;
goto
_e
nd
;
}
}
// first malloc 80KB, subsequent reallocation will expand the size as twice of the original size
// first malloc 80KB, subsequent reallocation will expand the size as twice of the original size
...
@@ -2868,7 +2868,7 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
...
@@ -2868,7 +2868,7 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
pMultiMeta
=
rpcMallocCont
(
totalMallocLen
);
pMultiMeta
=
rpcMallocCont
(
totalMallocLen
);
if
(
pMultiMeta
==
NULL
)
{
if
(
pMultiMeta
==
NULL
)
{
code
=
TSDB_CODE_MND_OUT_OF_MEMORY
;
code
=
TSDB_CODE_MND_OUT_OF_MEMORY
;
goto
_e
rror
;
goto
_e
nd
;
}
}
pMultiMeta
->
contLen
=
sizeof
(
SMultiTableMeta
);
pMultiMeta
->
contLen
=
sizeof
(
SMultiTableMeta
);
...
@@ -2878,12 +2878,11 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
...
@@ -2878,12 +2878,11 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
for
(;
t
<
pInfo
->
numOfTables
;
++
t
)
{
for
(;
t
<
pInfo
->
numOfTables
;
++
t
)
{
char
*
fullName
=
nameList
[
t
];
char
*
fullName
=
nameList
[
t
];
pMsg
->
pVgroup
=
NULL
;
pMsg
->
pTable
=
mnodeGetTable
(
fullName
);
pMsg
->
pTable
=
mnodeGetTable
(
fullName
);
if
(
pMsg
->
pTable
==
NULL
)
{
if
(
pMsg
->
pTable
==
NULL
)
{
mError
(
"msg:%p, app:%p table:%s, failed to get table meta, table not exist"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
fullName
);
mError
(
"msg:%p, app:%p table:%s, failed to get table meta, table not exist"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
fullName
);
code
=
TSDB_CODE_MND_INVALID_TABLE_NAME
;
code
=
TSDB_CODE_MND_INVALID_TABLE_NAME
;
goto
_e
rror
;
goto
_e
nd
;
}
}
if
(
pMsg
->
pDb
==
NULL
)
{
if
(
pMsg
->
pDb
==
NULL
)
{
...
@@ -2893,7 +2892,7 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
...
@@ -2893,7 +2892,7 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
if
(
pMsg
->
pDb
==
NULL
||
pMsg
->
pDb
->
status
!=
TSDB_DB_STATUS_READY
)
{
if
(
pMsg
->
pDb
==
NULL
||
pMsg
->
pDb
->
status
!=
TSDB_DB_STATUS_READY
)
{
mnodeDecTableRef
(
pMsg
->
pTable
);
mnodeDecTableRef
(
pMsg
->
pTable
);
code
=
TSDB_CODE_APP_NOT_READY
;
code
=
TSDB_CODE_APP_NOT_READY
;
goto
_e
rror
;
goto
_e
nd
;
}
}
int
remain
=
totalMallocLen
-
pMultiMeta
->
contLen
;
int
remain
=
totalMallocLen
-
pMultiMeta
->
contLen
;
...
@@ -2903,7 +2902,7 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
...
@@ -2903,7 +2902,7 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
if
(
pMultiMeta
==
NULL
)
{
if
(
pMultiMeta
==
NULL
)
{
mnodeDecTableRef
(
pMsg
->
pTable
);
mnodeDecTableRef
(
pMsg
->
pTable
);
code
=
TSDB_CODE_MND_OUT_OF_MEMORY
;
code
=
TSDB_CODE_MND_OUT_OF_MEMORY
;
goto
_e
rror
;
goto
_e
nd
;
}
}
}
}
...
@@ -2911,19 +2910,26 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
...
@@ -2911,19 +2910,26 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
if
(
pMsg
->
pTable
->
type
==
TSDB_SUPER_TABLE
)
{
if
(
pMsg
->
pTable
->
type
==
TSDB_SUPER_TABLE
)
{
code
=
mnodeDoGetSuperTableMeta
(
pMsg
,
pMeta
);
code
=
mnodeDoGetSuperTableMeta
(
pMsg
,
pMeta
);
taosArrayPush
(
pList
,
&
fullName
);
// keep the full name for each super table for retrieve vgroup list
taosArrayPush
(
pList
,
&
fullName
);
// keep the full name for each super table for retrieve vgroup list
}
else
{
}
else
{
code
=
mnodeDoGetChildTableMeta
(
pMsg
,
pMeta
);
code
=
mnodeDoGetChildTableMeta
(
pMsg
,
pMeta
);
if
(
pMsg
->
pVgroup
!=
NULL
)
{
mnodeDecVgroupRef
(
pMsg
->
pVgroup
);
pMsg
->
pVgroup
=
NULL
;
}
}
if
(
code
==
TSDB_CODE_SUCCESS
)
{
pMultiMeta
->
numOfTables
++
;
pMultiMeta
->
contLen
+=
pMeta
->
contLen
;
}
}
mnodeDecTableRef
(
pMsg
->
pTable
);
mnodeDecTableRef
(
pMsg
->
pTable
);
assert
(((
SCTableObj
*
)
pMsg
->
pTable
)
->
refCount
>=
1
);
pMsg
->
pTable
=
NULL
;
pMsg
->
pTable
=
NULL
;
if
(
code
==
TSDB_CODE_SUCCESS
)
{
pMultiMeta
->
numOfTables
++
;
pMultiMeta
->
contLen
+=
pMeta
->
contLen
;
}
else
{
// ignore error and continue.
// Otherwise the client may found that the responding message is inconsistent.
// goto _end;
}
}
}
char
*
msg
=
(
char
*
)
pMultiMeta
+
pMultiMeta
->
contLen
;
char
*
msg
=
(
char
*
)
pMultiMeta
+
pMultiMeta
->
contLen
;
...
@@ -2944,7 +2950,7 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
...
@@ -2944,7 +2950,7 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
if
(
pTable
==
NULL
)
{
if
(
pTable
==
NULL
)
{
mError
(
"msg:%p, app:%p stable:%s, not exist while get stable vgroup info"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
name
);
mError
(
"msg:%p, app:%p stable:%s, not exist while get stable vgroup info"
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
,
name
);
code
=
TSDB_CODE_MND_INVALID_TABLE_NAME
;
code
=
TSDB_CODE_MND_INVALID_TABLE_NAME
;
goto
_e
rror
;
goto
_e
nd
;
}
}
msg
=
serializeVgroupInfo
(
pTable
,
name
,
msg
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
);
msg
=
serializeVgroupInfo
(
pTable
,
name
,
msg
,
pMsg
,
pMsg
->
rpcMsg
.
ahandle
);
...
@@ -2955,15 +2961,18 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
...
@@ -2955,15 +2961,18 @@ static int32_t mnodeProcessMultiTableMetaMsg(SMnodeMsg *pMsg) {
pMultiMeta
->
numOfTables
=
htonl
(
pMultiMeta
->
numOfTables
);
pMultiMeta
->
numOfTables
=
htonl
(
pMultiMeta
->
numOfTables
);
pMsg
->
rpcRsp
.
rsp
=
pMultiMeta
;
pMsg
->
rpcRsp
.
rsp
=
pMultiMeta
;
pMsg
->
rpcRsp
.
len
=
pMultiMeta
->
contLen
;
pMsg
->
rpcRsp
.
len
=
pMultiMeta
->
contLen
;
code
=
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
_end:
_error:
tfree
(
str
);
tfree
(
str
);
tfree
(
nameList
);
tfree
(
nameList
);
rpcFreeCont
(
pMultiMeta
);
taosArrayDestroy
(
pList
);
taosArrayDestroy
(
pList
);
pMsg
->
pTable
=
NULL
;
pMsg
->
pTable
=
NULL
;
pMsg
->
pVgroup
=
NULL
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
rpcFreeCont
(
pMultiMeta
);
}
return
code
;
return
code
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录