Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
111c3451
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看板
未验证
提交
111c3451
编写于
6月 16, 2022
作者:
C
Cary Xu
提交者:
GitHub
6月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13893 from taosdata/feature/TD-14481-3.0
fix: not submit for stables without rollup in rsma database
上级
ca6633b3
f0a17847
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
39 addition
and
20 deletion
+39
-20
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+27
-17
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+1
-0
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+11
-3
未找到文件。
source/common/src/tdatablock.c
浏览文件 @
111c3451
...
...
@@ -1584,6 +1584,11 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SArray* pDataBlocks
int32_t
rowSize
=
pDataBlock
->
info
.
rowSize
;
int64_t
groupId
=
pDataBlock
->
info
.
groupId
;
if
(
colNum
<=
1
)
{
// invalid if only with TS col
continue
;
}
if
(
rb
.
nCols
!=
colNum
)
{
tdSRowSetTpInfo
(
&
rb
,
colNum
,
pTSchema
->
flen
);
}
...
...
@@ -1680,23 +1685,28 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq** pReq, const SArray* pDataBlocks
msgLen
+=
pSubmitBlk
->
dataLen
;
}
(
*
pReq
)
->
length
=
msgLen
;
(
*
pReq
)
->
header
.
vgId
=
htonl
(
vgId
);
(
*
pReq
)
->
header
.
contLen
=
htonl
(
msgLen
);
(
*
pReq
)
->
length
=
(
*
pReq
)
->
header
.
contLen
;
(
*
pReq
)
->
numOfBlocks
=
htonl
(
numOfBlks
);
SSubmitBlk
*
blk
=
(
SSubmitBlk
*
)((
*
pReq
)
+
1
);
while
(
numOfBlks
--
)
{
int32_t
dataLen
=
blk
->
dataLen
;
blk
->
uid
=
htobe64
(
blk
->
uid
);
blk
->
suid
=
htobe64
(
blk
->
suid
);
blk
->
padding
=
htonl
(
blk
->
padding
);
blk
->
sversion
=
htonl
(
blk
->
sversion
);
blk
->
dataLen
=
htonl
(
blk
->
dataLen
);
blk
->
schemaLen
=
htonl
(
blk
->
schemaLen
);
blk
->
numOfRows
=
htons
(
blk
->
numOfRows
);
blk
=
(
SSubmitBlk
*
)(
blk
->
data
+
dataLen
);
if
(
numOfBlks
>
0
)
{
(
*
pReq
)
->
length
=
msgLen
;
(
*
pReq
)
->
header
.
vgId
=
htonl
(
vgId
);
(
*
pReq
)
->
header
.
contLen
=
htonl
(
msgLen
);
(
*
pReq
)
->
length
=
(
*
pReq
)
->
header
.
contLen
;
(
*
pReq
)
->
numOfBlocks
=
htonl
(
numOfBlks
);
SSubmitBlk
*
blk
=
(
SSubmitBlk
*
)((
*
pReq
)
+
1
);
while
(
numOfBlks
--
)
{
int32_t
dataLen
=
blk
->
dataLen
;
blk
->
uid
=
htobe64
(
blk
->
uid
);
blk
->
suid
=
htobe64
(
blk
->
suid
);
blk
->
padding
=
htonl
(
blk
->
padding
);
blk
->
sversion
=
htonl
(
blk
->
sversion
);
blk
->
dataLen
=
htonl
(
blk
->
dataLen
);
blk
->
schemaLen
=
htonl
(
blk
->
schemaLen
);
blk
->
numOfRows
=
htons
(
blk
->
numOfRows
);
blk
=
(
SSubmitBlk
*
)(
blk
->
data
+
dataLen
);
}
}
else
{
// no valid rows
taosMemoryFreeClear
(
*
pReq
);
}
return
TSDB_CODE_SUCCESS
;
...
...
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
111c3451
...
...
@@ -260,6 +260,7 @@ struct SSma {
#define SMA_CFG(s) (&(s)->pVnode->config)
#define SMA_TSDB_CFG(s) (&(s)->pVnode->config.tsdbCfg)
#define SMA_RETENTION(s) ((SRetention *)&(s)->pVnode->config.tsdbCfg.retentions)
#define SMA_LOCKED(s) ((s)->locked)
#define SMA_META(s) ((s)->pVnode->pMeta)
#define SMA_VID(s) TD_VID((s)->pVnode)
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
111c3451
...
...
@@ -400,22 +400,24 @@ static FORCE_INLINE int32_t tdExecuteRSmaImpl(SSma *pSma, const void *pMsg, int3
}
if
(
taosArrayGetSize
(
pResult
)
>
0
)
{
#if
1
#if
0
char flag[10] = {0};
snprintf(flag, 10, "level %" PRIi8, level);
blockDebugShowData(pResult, flag);
#endif
STsdb
*
sinkTsdb
=
(
level
==
TSDB_RETENTION_L1
?
pSma
->
pRSmaTsdb1
:
pSma
->
pRSmaTsdb2
);
SSubmitReq
*
pReq
=
NULL
;
if
(
buildSubmitReqFromDataBlock
(
&
pReq
,
pResult
,
pTSchema
,
SMA_VID
(
pSma
),
suid
)
!=
0
)
{
if
(
buildSubmitReqFromDataBlock
(
&
pReq
,
pResult
,
pTSchema
,
SMA_VID
(
pSma
),
suid
)
<
0
)
{
taosArrayDestroy
(
pResult
);
return
TSDB_CODE_FAILED
;
}
if
(
tdProcessSubmitReq
(
sinkTsdb
,
INT64_MAX
,
pReq
)
!=
0
)
{
if
(
pReq
&&
tdProcessSubmitReq
(
sinkTsdb
,
INT64_MAX
,
pReq
)
<
0
)
{
taosArrayDestroy
(
pResult
);
taosMemoryFreeClear
(
pReq
);
return
TSDB_CODE_FAILED
;
}
taosMemoryFreeClear
(
pReq
);
}
else
{
smaDebug
(
"vgId:%d, no rsma % "
PRIi8
" data generated since %s"
,
SMA_VID
(
pSma
),
level
,
tstrerror
(
terrno
));
...
...
@@ -469,6 +471,12 @@ int32_t tdProcessRSmaSubmit(SSma *pSma, void *pMsg, int32_t inputType) {
return
TSDB_CODE_SUCCESS
;
}
SRetention
*
pRetention
=
SMA_RETENTION
(
pSma
);
if
(
!
RETENTION_VALID
(
pRetention
+
1
))
{
// return directly if retention level 1 is invalid
return
TSDB_CODE_SUCCESS
;
}
if
(
inputType
==
STREAM_DATA_TYPE_SUBMIT_BLOCK
)
{
STbUidStore
uidStore
=
{
0
};
tdFetchSubmitReqSuids
(
pMsg
,
&
uidStore
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录