Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0de7f3e3
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看板
提交
0de7f3e3
编写于
8月 20, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: rsma code optimization
上级
f9e0aad8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
25 deletion
+17
-25
source/dnode/vnode/src/inc/sma.h
source/dnode/vnode/src/inc/sma.h
+0
-1
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+17
-24
未找到文件。
source/dnode/vnode/src/inc/sma.h
浏览文件 @
0de7f3e3
...
...
@@ -123,7 +123,6 @@ struct SRSmaInfoItem {
uint8_t
nSkipped
;
// number of skipped to fetch data from all active window
int8_t
fetchLevel
;
int32_t
maxDelay
;
// ms
int64_t
lastFetch
;
// ms
tmr_h
tmrId
;
};
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
0de7f3e3
...
...
@@ -19,9 +19,8 @@
#define RSMA_QTASKINFO_HEAD_LEN (sizeof(int32_t) + sizeof(int8_t) + sizeof(int64_t)) // len + type + suid
#define RSMA_QTASKEXEC_SMOOTH_SIZE (100) // cnt
#define RSMA_SUBMIT_BATCH_SIZE (1024) // cnt
#define RSMA_FETCH_DELAY_MAX (180000) // ms
#define RSMA_FETCH_SKIP_MAX (10) // cnt
#define RSMA_FETCH_ACTIVE_MAX (180) // ms
#define RSMA_FETCH_DELAY_MAX (900000) // ms
#define RSMA_FETCH_ACTIVE_MAX (1800) // ms
SSmaMgmt
smaMgmt
=
{
.
inited
=
0
,
...
...
@@ -1646,26 +1645,20 @@ static int32_t tdRSmaConsumeAndFetch(SSma *pSma, SRSmaInfo *pInfo, SArray *pSubm
}
int64_t
curMs
=
taosGetTimestampMs
();
// if ((pItem->nSkipped > RSMA_FETCH_SKIP_MAX) || (pItem->nSkipped * pItem->maxDelay) > RSMA_FETCH_DELAY_MAX) {
// pItem->nSkipped = 0;
// smaInfo("vgId:%d, suid:%" PRIi64 " level:%" PRIi8 " nSkipped:%" PRIi8 " maxDelay:%d, fetch executed",
// SMA_VID(pSma), pInfo->suid, i, pItem->nSkipped, pItem->maxDelay);
// } else {
// if (((curMs - pInfo->lastRecv) < RSMA_FETCH_ACTIVE_MAX)) {
// ++pItem->nSkipped;
// smaDebug("vgId:%d, suid:%" PRIi64 " level:%" PRIi8 " curMs:%" PRIi64 " lastRecv:%" PRIi64 ", fetch skipped ",
// SMA_VID(pSma), pInfo->suid, i, curMs, pInfo->lastRecv);
// continue;
// } else {
// smaInfo("vgId:%d, suid:%" PRIi64 " level:%" PRIi8 " curMs:%" PRIi64 " lastRecv:%" PRIi64 ", fetch executed ",
// SMA_VID(pSma), pInfo->suid, i, curMs, pInfo->lastRecv);
// }
// }
pItem
->
lastFetch
=
curMs
;
// smaInfo("vgId:%d, suid:%" PRIi64 " level:%" PRIi8 " curMs:%" PRIi64 " lastRecv:%" PRIi64 ", fetch executed ",
// SMA_VID(pSma), pInfo->suid, i, curMs, pInfo->lastRecv);
if
((
pItem
->
nSkipped
*
pItem
->
maxDelay
)
>
RSMA_FETCH_DELAY_MAX
)
{
smaInfo
(
"vgId:%d, suid:%"
PRIi64
" level:%"
PRIi8
" nSkipped:%"
PRIi8
" maxDelay:%d, fetch executed"
,
SMA_VID
(
pSma
),
pInfo
->
suid
,
i
,
pItem
->
nSkipped
,
pItem
->
maxDelay
);
}
else
if
(((
curMs
-
pInfo
->
lastRecv
)
<
RSMA_FETCH_ACTIVE_MAX
))
{
++
pItem
->
nSkipped
;
smaDebug
(
"vgId:%d, suid:%"
PRIi64
" level:%"
PRIi8
" curMs:%"
PRIi64
" lastRecv:%"
PRIi64
", fetch skipped "
,
SMA_VID
(
pSma
),
pInfo
->
suid
,
i
,
curMs
,
pInfo
->
lastRecv
);
continue
;
}
else
{
smaInfo
(
"vgId:%d, suid:%"
PRIi64
" level:%"
PRIi8
" curMs:%"
PRIi64
" lastRecv:%"
PRIi64
", fetch executed "
,
SMA_VID
(
pSma
),
pInfo
->
suid
,
i
,
curMs
,
pInfo
->
lastRecv
);
}
pItem
->
nSkipped
=
0
;
if
((
terrno
=
qSetMultiStreamInput
(
taskInfo
,
&
dataBlock
,
1
,
STREAM_INPUT__DATA_BLOCK
))
<
0
)
{
goto
_err
;
...
...
@@ -1680,7 +1673,7 @@ static int32_t tdRSmaConsumeAndFetch(SSma *pSma, SRSmaInfo *pInfo, SArray *pSubm
SMA_VID
(
pSma
),
pInfo
->
suid
,
i
,
pItem
->
nSkipped
,
pItem
->
maxDelay
);
}
else
{
smaDebug
(
"vgId:%d, suid:%"
PRIi64
" level:%"
PRIi8
" nSkipped:%"
PRIi8
" maxDelay:%d, fetch not executed as fetch
L
evel is %"
PRIi8
,
" maxDelay:%d, fetch not executed as fetch
l
evel is %"
PRIi8
,
SMA_VID
(
pSma
),
pInfo
->
suid
,
i
,
pItem
->
nSkipped
,
pItem
->
maxDelay
,
pItem
->
fetchLevel
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录