Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0beed37c
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1181
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0beed37c
编写于
8月 06, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: insert tsma data
上级
20a0362d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
4 deletion
+17
-4
source/common/src/tglobal.c
source/common/src/tglobal.c
+1
-1
source/dnode/mnode/impl/src/mndSma.c
source/dnode/mnode/impl/src/mndSma.c
+4
-1
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+2
-0
source/dnode/vnode/src/sma/smaTimeRange.c
source/dnode/vnode/src/sma/smaTimeRange.c
+9
-1
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+1
-1
未找到文件。
source/common/src/tglobal.c
浏览文件 @
0beed37c
...
@@ -89,7 +89,7 @@ bool tsSmlDataFormat =
...
@@ -89,7 +89,7 @@ bool tsSmlDataFormat =
// query
// query
int32_t
tsQueryPolicy
=
1
;
int32_t
tsQueryPolicy
=
1
;
int32_t
tsQuerySmaOptimize
=
0
;
int32_t
tsQuerySmaOptimize
=
1
;
/*
/*
* denote if the server needs to compress response message at the application layer to client, including query rsp,
* denote if the server needs to compress response message at the application layer to client, including query rsp,
...
...
source/dnode/mnode/impl/src/mndSma.c
浏览文件 @
0beed37c
...
@@ -489,7 +489,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
...
@@ -489,7 +489,7 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
smaObj
.
uid
=
mndGenerateUid
(
pCreate
->
name
,
TSDB_TABLE_FNAME_LEN
);
smaObj
.
uid
=
mndGenerateUid
(
pCreate
->
name
,
TSDB_TABLE_FNAME_LEN
);
ASSERT
(
smaObj
.
uid
!=
0
);
ASSERT
(
smaObj
.
uid
!=
0
);
char
resultTbName
[
TSDB_TABLE_FNAME_LEN
+
16
]
=
{
0
};
char
resultTbName
[
TSDB_TABLE_FNAME_LEN
+
16
]
=
{
0
};
snprintf
(
resultTbName
,
TSDB_TABLE_FNAME_LEN
+
16
,
"
td.tsma.rst.tb.%s"
,
pCreate
->
name
);
snprintf
(
resultTbName
,
TSDB_TABLE_FNAME_LEN
+
16
,
"
%s_td_tsma_rst_tb"
,
pCreate
->
name
);
memcpy
(
smaObj
.
dstTbName
,
resultTbName
,
TSDB_TABLE_FNAME_LEN
);
memcpy
(
smaObj
.
dstTbName
,
resultTbName
,
TSDB_TABLE_FNAME_LEN
);
smaObj
.
dstTbUid
=
mndGenerateUid
(
smaObj
.
dstTbName
,
TSDB_TABLE_FNAME_LEN
);
smaObj
.
dstTbUid
=
mndGenerateUid
(
smaObj
.
dstTbName
,
TSDB_TABLE_FNAME_LEN
);
smaObj
.
stbUid
=
pStb
->
uid
;
smaObj
.
stbUid
=
pStb
->
uid
;
...
@@ -603,6 +603,9 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
...
@@ -603,6 +603,9 @@ static int32_t mndCreateSma(SMnode *pMnode, SRpcMsg *pReq, SMCreateSmaReq *pCrea
if
(
mndPersistStream
(
pMnode
,
pTrans
,
&
streamObj
)
!=
0
)
goto
_OVER
;
if
(
mndPersistStream
(
pMnode
,
pTrans
,
&
streamObj
)
!=
0
)
goto
_OVER
;
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
_OVER
;
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
_OVER
;
mDebug
(
"mndSma: create sma index %s %"
PRIi64
" on stb:%"
PRIi64
", dstSuid:%"
PRIi64
" dstTb:%s dstVg:%d"
,
pCreate
->
name
,
smaObj
.
uid
,
smaObj
.
stbUid
,
smaObj
.
dstTbUid
,
smaObj
.
dstTbName
,
smaObj
.
dstVgId
);
code
=
0
;
code
=
0
;
_OVER:
_OVER:
...
...
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
0beed37c
...
@@ -381,6 +381,8 @@ int metaCreateTable(SMeta *pMeta, int64_t version, SVCreateTbReq *pReq) {
...
@@ -381,6 +381,8 @@ int metaCreateTable(SMeta *pMeta, int64_t version, SVCreateTbReq *pReq) {
terrno
=
TSDB_CODE_TDB_TABLE_ALREADY_EXIST
;
terrno
=
TSDB_CODE_TDB_TABLE_ALREADY_EXIST
;
metaReaderClear
(
&
mr
);
metaReaderClear
(
&
mr
);
return
-
1
;
return
-
1
;
}
else
if
(
terrno
==
TSDB_CODE_PAR_TABLE_NOT_EXIST
)
{
terrno
=
TSDB_CODE_SUCCESS
;
}
}
metaReaderClear
(
&
mr
);
metaReaderClear
(
&
mr
);
...
...
source/dnode/vnode/src/sma/smaTimeRange.c
浏览文件 @
0beed37c
...
@@ -116,8 +116,10 @@ int32_t tdProcessTSmaCreateImpl(SSma *pSma, int64_t version, const char *pMsg) {
...
@@ -116,8 +116,10 @@ int32_t tdProcessTSmaCreateImpl(SSma *pSma, int64_t version, const char *pMsg) {
}
}
// create stable to save tsma result in dstVgId
// create stable to save tsma result in dstVgId
SName
stbFullName
=
{
0
};
tNameFromString
(
&
stbFullName
,
pCfg
->
dstTbName
,
T_NAME_ACCT
|
T_NAME_DB
|
T_NAME_TABLE
);
SVCreateStbReq
pReq
=
{
0
};
SVCreateStbReq
pReq
=
{
0
};
pReq
.
name
=
pCfg
->
dstTbName
;
pReq
.
name
=
(
char
*
)
tNameGetTableName
(
&
stbFullName
)
;
pReq
.
suid
=
pCfg
->
dstTbUid
;
pReq
.
suid
=
pCfg
->
dstTbUid
;
pReq
.
schemaRow
=
pCfg
->
schemaRow
;
pReq
.
schemaRow
=
pCfg
->
schemaRow
;
pReq
.
schemaTag
=
pCfg
->
schemaTag
;
pReq
.
schemaTag
=
pCfg
->
schemaTag
;
...
@@ -125,6 +127,12 @@ int32_t tdProcessTSmaCreateImpl(SSma *pSma, int64_t version, const char *pMsg) {
...
@@ -125,6 +127,12 @@ int32_t tdProcessTSmaCreateImpl(SSma *pSma, int64_t version, const char *pMsg) {
if
(
metaCreateSTable
(
SMA_META
(
pSma
),
version
,
&
pReq
)
<
0
)
{
if
(
metaCreateSTable
(
SMA_META
(
pSma
),
version
,
&
pReq
)
<
0
)
{
return
-
1
;
return
-
1
;
}
}
smaDebug
(
"vgId:%d, success to create sma index %s %"
PRIi64
" on stb:%"
PRIi64
", dstSuid:%"
PRIi64
" dstTb:%s dstVg:%d"
,
SMA_VID
(
pSma
),
pCfg
->
indexName
,
pCfg
->
indexUid
,
pCfg
->
tableUid
,
pCfg
->
dstTbUid
,
pReq
.
name
,
pCfg
->
dstVgId
);
}
else
{
ASSERT
(
0
);
}
}
return
0
;
return
0
;
...
...
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
0beed37c
...
@@ -351,7 +351,6 @@ int32_t vnodeProcessFetchMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo) {
...
@@ -351,7 +351,6 @@ int32_t vnodeProcessFetchMsg(SVnode *pVnode, SRpcMsg *pMsg, SQueueInfo *pInfo) {
// TODO: remove the function
// TODO: remove the function
void
smaHandleRes
(
void
*
pVnode
,
int64_t
smaId
,
const
SArray
*
data
)
{
void
smaHandleRes
(
void
*
pVnode
,
int64_t
smaId
,
const
SArray
*
data
)
{
// TODO
// TODO
blockDebugShowDataBlocks
(
data
,
__func__
);
blockDebugShowDataBlocks
(
data
,
__func__
);
tdProcessTSmaInsert
(((
SVnode
*
)
pVnode
)
->
pSma
,
smaId
,
(
const
char
*
)
data
);
tdProcessTSmaInsert
(((
SVnode
*
)
pVnode
)
->
pSma
,
smaId
,
(
const
char
*
)
data
);
}
}
...
@@ -852,6 +851,7 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
...
@@ -852,6 +851,7 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
if
(
metaCreateTable
(
pVnode
->
pMeta
,
version
,
&
createTbReq
)
<
0
)
{
if
(
metaCreateTable
(
pVnode
->
pMeta
,
version
,
&
createTbReq
)
<
0
)
{
if
(
terrno
!=
TSDB_CODE_TDB_TABLE_ALREADY_EXIST
)
{
if
(
terrno
!=
TSDB_CODE_TDB_TABLE_ALREADY_EXIST
)
{
submitBlkRsp
.
code
=
terrno
;
submitBlkRsp
.
code
=
terrno
;
pRsp
->
code
=
terrno
;
tDecoderClear
(
&
decoder
);
tDecoderClear
(
&
decoder
);
taosArrayDestroy
(
createTbReq
.
ctb
.
tagName
);
taosArrayDestroy
(
createTbReq
.
ctb
.
tagName
);
goto
_exit
;
goto
_exit
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录