Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
150956ff
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看板
提交
150956ff
编写于
8月 24, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: update tbMeta after creating table
上级
0ebd3281
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
43 addition
and
11 deletion
+43
-11
include/common/tmsg.h
include/common/tmsg.h
+1
-1
include/libs/qcom/query.h
include/libs/qcom/query.h
+1
-0
source/common/src/tmsg.c
source/common/src/tmsg.c
+1
-1
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+1
-1
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+12
-3
source/libs/qcom/src/queryUtil.c
source/libs/qcom/src/queryUtil.c
+7
-2
source/libs/qcom/src/querymsg.c
source/libs/qcom/src/querymsg.c
+13
-0
source/libs/scheduler/src/schRemote.c
source/libs/scheduler/src/schRemote.c
+7
-3
未找到文件。
include/common/tmsg.h
浏览文件 @
150956ff
...
...
@@ -1276,7 +1276,7 @@ void tFreeSMAlterStbRsp(SMAlterStbRsp* pRsp);
int32_t
tSerializeSTableMetaRsp
(
void
*
buf
,
int32_t
bufLen
,
STableMetaRsp
*
pRsp
);
int32_t
tDeserializeSTableMetaRsp
(
void
*
buf
,
int32_t
bufLen
,
STableMetaRsp
*
pRsp
);
void
tFreeSTableMetaRsp
(
STableMetaRsp
*
pRsp
);
void
tFreeSTableMetaRsp
(
void
*
pRsp
);
void
tFreeSTableIndexRsp
(
void
*
info
);
typedef
struct
{
...
...
include/libs/qcom/query.h
浏览文件 @
150956ff
...
...
@@ -215,6 +215,7 @@ void initQueryModuleMsgHandle();
const
SSchema
*
tGetTbnameColumnSchema
();
bool
tIsValidSchema
(
struct
SSchema
*
pSchema
,
int32_t
numOfCols
,
int32_t
numOfTags
);
int32_t
queryCreateCTableMetaFromMsg
(
STableMetaRsp
*
msg
,
SCTableMeta
*
pMeta
);
int32_t
queryCreateTableMetaFromMsg
(
STableMetaRsp
*
msg
,
bool
isSuperTable
,
STableMeta
**
pMeta
);
char
*
jobTaskStatusStr
(
int32_t
status
);
...
...
source/common/src/tmsg.c
浏览文件 @
150956ff
...
...
@@ -3330,7 +3330,7 @@ int32_t tDeserializeSSTbHbRsp(void *buf, int32_t bufLen, SSTbHbRsp *pRsp) {
return
0
;
}
void
tFreeSTableMetaRsp
(
STableMetaRsp
*
pRsp
)
{
taosMemoryFreeClear
(
pRsp
->
pSchemas
);
}
void
tFreeSTableMetaRsp
(
void
*
pRsp
)
{
taosMemoryFreeClear
(((
STableMetaRsp
*
)
pRsp
)
->
pSchemas
);
}
void
tFreeSTableIndexRsp
(
void
*
info
)
{
if
(
NULL
==
info
)
{
...
...
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
150956ff
...
...
@@ -437,7 +437,7 @@ int metaCreateTable(SMeta *pMeta, int64_t version, SVCreateTbReq *pReq, STableMe
(
*
pMetaRsp
)
->
suid
=
pReq
->
ctb
.
suid
;
strcpy
((
*
pMetaRsp
)
->
tbName
,
pReq
->
name
);
}
else
{
metaUpdateMetaRsp
(
pReq
->
uid
,
pReq
->
name
,
pReq
->
ntb
.
schemaRow
,
*
pMetaRsp
);
metaUpdateMetaRsp
(
pReq
->
uid
,
pReq
->
name
,
&
pReq
->
ntb
.
schemaRow
,
*
pMetaRsp
);
}
}
}
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
150956ff
...
...
@@ -270,13 +270,22 @@ int32_t ctgUpdateTbMeta(SCatalog* pCtg, STableMetaRsp* rspMsg, bool syncOp) {
int32_t
code
=
0
;
strcpy
(
output
->
dbFName
,
rspMsg
->
dbFName
);
strcpy
(
output
->
tbName
,
rspMsg
->
tbName
);
output
->
dbId
=
rspMsg
->
dbId
;
SET_META_TYPE_TABLE
(
output
->
metaType
);
if
(
TSDB_CHILD_TABLE
==
rspMsg
->
tableType
&&
NULL
==
rspMsg
->
pSchemas
)
{
strcpy
(
output
->
ctbName
,
rspMsg
->
tbName
);
CTG_ERR_JRET
(
queryCreateTableMetaFromMsg
(
rspMsg
,
rspMsg
->
tableType
==
TSDB_SUPER_TABLE
,
&
output
->
tbMeta
));
SET_META_TYPE_CTABLE
(
output
->
metaType
);
CTG_ERR_JRET
(
queryCreateCTableMetaFromMsg
(
rspMsg
,
&
output
->
ctbMeta
));
}
else
{
strcpy
(
output
->
tbName
,
rspMsg
->
tbName
);
SET_META_TYPE_TABLE
(
output
->
metaType
);
CTG_ERR_JRET
(
queryCreateTableMetaFromMsg
(
rspMsg
,
rspMsg
->
tableType
==
TSDB_SUPER_TABLE
,
&
output
->
tbMeta
));
}
CTG_ERR_JRET
(
ctgUpdateTbMetaEnqueue
(
pCtg
,
output
,
syncOp
));
...
...
source/libs/qcom/src/queryUtil.c
浏览文件 @
150956ff
...
...
@@ -213,6 +213,11 @@ SSchema createSchema(int8_t type, int32_t bytes, col_id_t colId, const char* nam
return
s
;
}
void
freeSTableMetaRspPointer
(
void
*
p
)
{
tFreeSTableMetaRsp
(
*
(
void
**
)
p
);
taosMemoryFreeClear
(
*
(
void
**
)
p
);
}
void
destroyQueryExecRes
(
SExecResult
*
pRes
)
{
if
(
NULL
==
pRes
||
NULL
==
pRes
->
res
)
{
return
;
...
...
@@ -220,13 +225,13 @@ void destroyQueryExecRes(SExecResult* pRes) {
switch
(
pRes
->
msgType
)
{
case
TDMT_VND_CREATE_TABLE
:
{
taosArrayDestroyEx
((
SArray
*
)
pRes
->
res
,
tFreeSTableMetaRsp
);
taosArrayDestroyEx
((
SArray
*
)
pRes
->
res
,
freeSTableMetaRspPointer
);
break
;
}
case
TDMT_MND_CREATE_STB
:
case
TDMT_VND_ALTER_TABLE
:
case
TDMT_MND_ALTER_STB
:
{
tFreeSTableMetaRsp
(
(
STableMetaRsp
*
)
pRes
->
res
);
tFreeSTableMetaRsp
(
pRes
->
res
);
taosMemoryFreeClear
(
pRes
->
res
);
break
;
}
...
...
source/libs/qcom/src/querymsg.c
浏览文件 @
150956ff
...
...
@@ -354,6 +354,19 @@ static int32_t queryConvertTableMetaMsg(STableMetaRsp *pMetaMsg) {
return
TSDB_CODE_SUCCESS
;
}
int32_t
queryCreateCTableMetaFromMsg
(
STableMetaRsp
*
msg
,
SCTableMeta
*
pMeta
)
{
pMeta
->
vgId
=
msg
->
vgId
;
pMeta
->
tableType
=
msg
->
tableType
;
pMeta
->
uid
=
msg
->
tuid
;
pMeta
->
suid
=
msg
->
suid
;
qDebug
(
"ctable %s uid %"
PRIx64
" meta returned, type %d vgId:%d db %s suid %"
PRIx64
,
msg
->
tbName
,
pMeta
->
uid
,
pMeta
->
tableType
,
pMeta
->
vgId
,
msg
->
dbFName
,
pMeta
->
suid
);
return
TSDB_CODE_SUCCESS
;
}
int32_t
queryCreateTableMetaFromMsg
(
STableMetaRsp
*
msg
,
bool
isStb
,
STableMeta
**
pMeta
)
{
int32_t
total
=
msg
->
numOfColumns
+
msg
->
numOfTags
;
int32_t
metaSize
=
sizeof
(
STableMeta
)
+
sizeof
(
SSchema
)
*
total
;
...
...
source/libs/scheduler/src/schRemote.c
浏览文件 @
150956ff
...
...
@@ -102,8 +102,11 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa
tDecoderInit
(
&
coder
,
msg
,
msgSize
);
code
=
tDecodeSVCreateTbBatchRsp
(
&
coder
,
&
batchRsp
);
if
(
TSDB_CODE_SUCCESS
==
code
&&
batchRsp
.
nRsps
>
0
)
{
pJob
->
execRes
.
res
=
taosArrayInit
(
batchRsp
.
nRsps
,
POINTER_BYTES
);
pJob
->
execRes
.
msgType
=
TDMT_VND_CREATE_TABLE
;
SCH_LOCK
(
SCH_WRITE
,
&
pJob
->
resLock
);
if
(
NULL
==
pJob
->
execRes
.
res
)
{
pJob
->
execRes
.
res
=
taosArrayInit
(
batchRsp
.
nRsps
,
POINTER_BYTES
);
pJob
->
execRes
.
msgType
=
TDMT_VND_CREATE_TABLE
;
}
for
(
int32_t
i
=
0
;
i
<
batchRsp
.
nRsps
;
++
i
)
{
SVCreateTbRsp
*
rsp
=
batchRsp
.
pRsps
+
i
;
...
...
@@ -115,6 +118,7 @@ int32_t schHandleResponseMsg(SSchJob *pJob, SSchTask *pTask, int32_t execId, SDa
code
=
rsp
->
code
;
}
}
SCH_UNLOCK
(
SCH_WRITE
,
&
pJob
->
resLock
);
if
(
taosArrayGetSize
((
SArray
*
)
pJob
->
execRes
.
res
)
<=
0
)
{
taosArrayDestroy
((
SArray
*
)
pJob
->
execRes
.
res
);
...
...
@@ -1113,7 +1117,7 @@ int32_t schBuildAndSendMsg(SSchJob *pJob, SSchTask *pTask, SQueryNodeAddr *addr,
break
;
}
#if
1
#if
0
SSchTrans trans = {.pTrans = pJob->conn.pTrans, .pHandle = SCH_GET_TASK_HANDLE(pTask)};
code = schAsyncSendMsg(pJob, pTask, &trans, addr, msgType, msg, msgSize, persistHandle, (rpcCtx.args ? &rpcCtx : NULL));
msg = NULL;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录