Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
57437312
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看板
提交
57437312
编写于
9月 04, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
other: rsma code optimization
上级
54562e24
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
14 deletion
+15
-14
source/dnode/vnode/src/inc/sma.h
source/dnode/vnode/src/inc/sma.h
+1
-0
source/dnode/vnode/src/sma/smaCommit.c
source/dnode/vnode/src/sma/smaCommit.c
+0
-1
source/dnode/vnode/src/sma/smaEnv.c
source/dnode/vnode/src/sma/smaEnv.c
+1
-1
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+13
-12
未找到文件。
source/dnode/vnode/src/inc/sma.h
浏览文件 @
57437312
...
...
@@ -148,6 +148,7 @@ struct SRSmaInfoItem {
};
struct
SRSmaInfo
{
SSma
*
pSma
;
STSchema
*
pTSchema
;
int64_t
suid
;
int64_t
lastRecv
;
// ms
...
...
source/dnode/vnode/src/sma/smaCommit.c
浏览文件 @
57437312
...
...
@@ -364,7 +364,6 @@ static int32_t tdProcessRSmaAsyncPostCommitImpl(SSma *pSma) {
}
SRSmaStat
*
pRSmaStat
=
(
SRSmaStat
*
)
SMA_ENV_STAT
(
pEnv
);
SRSmaInfoItem
*
pItem
=
NULL
;
// step 1: merge qTaskInfo and iQTaskInfo
// lock
...
...
source/dnode/vnode/src/sma/smaEnv.c
浏览文件 @
57437312
...
...
@@ -220,7 +220,7 @@ static void tRSmaInfoHashFreeNode(void *data) {
if
((
pItem
=
RSMA_INFO_ITEM
((
SRSmaInfo
*
)
pRSmaInfo
,
1
))
&&
pItem
->
level
)
{
taosHashRemove
(
smaMgmt
.
refHash
,
&
pItem
,
POINTER_BYTES
);
}
tdFreeRSmaInfo
(
NULL
,
pRSmaInfo
,
true
);
tdFreeRSmaInfo
(
pRSmaInfo
->
pSma
,
pRSmaInfo
,
true
);
}
}
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
57437312
...
...
@@ -121,27 +121,27 @@ static void tdRSmaQTaskInfoFree(qTaskInfo_t *taskHandle, int32_t vgId, int32_t l
*/
void
*
tdFreeRSmaInfo
(
SSma
*
pSma
,
SRSmaInfo
*
pInfo
,
bool
isDeepFree
)
{
if
(
pInfo
)
{
int32_t
vid
=
pSma
?
SMA_VID
(
pSma
)
:
-
1
;
for
(
int32_t
i
=
0
;
i
<
TSDB_RETENTION_L2
;
++
i
)
{
SRSmaInfoItem
*
pItem
=
&
pInfo
->
items
[
i
];
if
(
isDeepFree
&&
pItem
->
tmrId
)
{
smaDebug
(
"vgId:%d, stop fetch timer %p for table %"
PRIi64
" level %d"
,
vid
,
pItem
->
tmrId
,
pInfo
->
suid
,
i
+
1
);
smaDebug
(
"vgId:%d, stop fetch timer %p for table %"
PRIi64
" level %d"
,
SMA_VID
(
pSma
),
pItem
->
tmrId
,
pInfo
->
suid
,
i
+
1
);
taosTmrStopA
(
&
pItem
->
tmrId
);
}
if
(
isDeepFree
&&
pInfo
->
taskInfo
[
i
])
{
tdRSmaQTaskInfoFree
(
&
pInfo
->
taskInfo
[
i
],
vid
,
i
+
1
);
tdRSmaQTaskInfoFree
(
&
pInfo
->
taskInfo
[
i
],
SMA_VID
(
pSma
)
,
i
+
1
);
}
else
{
smaDebug
(
"vgId:%d, table %"
PRIi64
" no need to destroy rsma info level %d since empty taskInfo"
,
vid
,
smaDebug
(
"vgId:%d, table %"
PRIi64
" no need to destroy rsma info level %d since empty taskInfo"
,
SMA_VID
(
pSma
)
,
pInfo
->
suid
,
i
+
1
);
}
if
(
pInfo
->
iTaskInfo
[
i
])
{
tdRSmaQTaskInfoFree
(
&
pInfo
->
iTaskInfo
[
i
],
vid
,
i
+
1
);
tdRSmaQTaskInfoFree
(
&
pInfo
->
iTaskInfo
[
i
],
SMA_VID
(
pSma
)
,
i
+
1
);
}
else
{
smaDebug
(
"vgId:%d, table %"
PRIi64
" no need to destroy rsma info level %d since empty iTaskInfo"
,
vid
,
pInfo
->
suid
,
i
+
1
);
smaDebug
(
"vgId:%d, table %"
PRIi64
" no need to destroy rsma info level %d since empty iTaskInfo"
,
SMA_VID
(
pSma
),
pInfo
->
suid
,
i
+
1
);
}
}
if
(
isDeepFree
)
{
...
...
@@ -377,7 +377,10 @@ int32_t tdRSmaProcessCreateImpl(SSma *pSma, SRSmaParam *param, int64_t suid, con
terrno
=
TSDB_CODE_TDB_IVD_TB_SCHEMA_VERSION
;
goto
_err
;
}
pRSmaInfo
->
pSma
=
pSma
;
pRSmaInfo
->
pTSchema
=
pTSchema
;
pRSmaInfo
->
suid
=
suid
;
T_REF_INIT_VAL
(
pRSmaInfo
,
1
);
if
(
!
(
pRSmaInfo
->
queue
=
taosOpenQueue
()))
{
goto
_err
;
}
...
...
@@ -391,8 +394,6 @@ int32_t tdRSmaProcessCreateImpl(SSma *pSma, SRSmaParam *param, int64_t suid, con
if
(
!
(
pRSmaInfo
->
iQall
=
taosAllocateQall
()))
{
goto
_err
;
}
pRSmaInfo
->
suid
=
suid
;
T_REF_INIT_VAL
(
pRSmaInfo
,
1
);
if
(
tdSetRSmaInfoItemParams
(
pSma
,
param
,
pStat
,
pRSmaInfo
,
0
)
<
0
)
{
goto
_err
;
...
...
@@ -1586,8 +1587,8 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) {
if
(
!
(
pStat
=
(
SRSmaStat
*
)
tdAcquireSmaRef
(
smaMgmt
.
rsetId
,
pRSmaRef
->
refId
)))
{
smaDebug
(
"rsma fetch task not start since rsma stat already destroyed, rsetId:%"
PRIi64
" refId:%d)"
,
smaMgmt
.
rsetId
,
pRSmaRef
->
refId
);
// pRSmaRef freed in taosHashRemove
taosHashRemove
(
smaMgmt
.
refHash
,
&
param
,
POINTER_BYTES
);
smaMgmt
.
rsetId
,
pRSmaRef
->
refId
);
// pRSmaRef freed in taosHashRemove
taosHashRemove
(
smaMgmt
.
refHash
,
&
param
,
POINTER_BYTES
);
return
;
}
...
...
@@ -1636,7 +1637,7 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) {
switch
(
fetchTriggerStat
)
{
case
TASK_TRIGGER_STAT_ACTIVE
:
{
smaDebug
(
"vgId:%d, rsma fetch task planned for level:%"
PRIi8
" suid:%"
PRIi64
" since stat is active"
,
SMA_VID
(
pSma
),
pItem
->
level
,
pRSmaInfo
->
suid
);
SMA_VID
(
pSma
),
pItem
->
level
,
pRSmaInfo
->
suid
);
// async process
pItem
->
fetchLevel
=
pItem
->
level
;
#if 0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录