Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
54562e24
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看板
提交
54562e24
编写于
9月 04, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: rsma fs restore procedure optimization
上级
18c3f19b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
4 deletion
+11
-4
source/dnode/vnode/src/sma/smaFS.c
source/dnode/vnode/src/sma/smaFS.c
+9
-2
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+2
-2
未找到文件。
source/dnode/vnode/src/sma/smaFS.c
浏览文件 @
54562e24
...
@@ -33,6 +33,8 @@ int32_t tdRSmaFSOpen(SSma *pSma, int64_t version) {
...
@@ -33,6 +33,8 @@ int32_t tdRSmaFSOpen(SSma *pSma, int64_t version) {
SSmaEnv
*
pEnv
=
SMA_RSMA_ENV
(
pSma
);
SSmaEnv
*
pEnv
=
SMA_RSMA_ENV
(
pSma
);
SRSmaStat
*
pStat
=
NULL
;
SRSmaStat
*
pStat
=
NULL
;
SArray
*
output
=
NULL
;
SArray
*
output
=
NULL
;
terrno
=
TSDB_CODE_SUCCESS
;
if
(
!
pEnv
)
{
if
(
!
pEnv
)
{
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
@@ -62,7 +64,7 @@ _end:
...
@@ -62,7 +64,7 @@ _end:
}
}
taosArrayDestroy
(
output
);
taosArrayDestroy
(
output
);
if
(
terrno
!=
0
)
{
if
(
terrno
!=
TSDB_CODE_SUCCESS
)
{
smaError
(
"vgId:%d, open rsma fs failed since %s"
,
TD_VID
(
pVnode
),
terrstr
());
smaError
(
"vgId:%d, open rsma fs failed since %s"
,
TD_VID
(
pVnode
),
terrstr
());
return
TSDB_CODE_FAILED
;
return
TSDB_CODE_FAILED
;
}
}
...
@@ -138,6 +140,11 @@ static int32_t tdFetchQTaskInfoFiles(SSma *pSma, int64_t version, SArray **outpu
...
@@ -138,6 +140,11 @@ static int32_t tdFetchQTaskInfoFiles(SSma *pSma, int64_t version, SArray **outpu
tdGetVndDirName
(
TD_VID
(
pVnode
),
tfsGetPrimaryPath
(
pVnode
->
pTfs
),
VNODE_RSMA_DIR
,
true
,
dir
);
tdGetVndDirName
(
TD_VID
(
pVnode
),
tfsGetPrimaryPath
(
pVnode
->
pTfs
),
VNODE_RSMA_DIR
,
true
,
dir
);
if
(
!
taosCheckExistFile
(
dir
))
{
smaDebug
(
"vgId:%d, fetch qtask files, no need as dir %s not exist"
,
TD_VID
(
pVnode
),
dir
);
return
TSDB_CODE_SUCCESS
;
}
// Resource allocation and init
// Resource allocation and init
if
((
code
=
regcomp
(
&
regex
,
pattern
,
REG_EXTENDED
))
!=
0
)
{
if
((
code
=
regcomp
(
&
regex
,
pattern
,
REG_EXTENDED
))
!=
0
)
{
terrno
=
TSDB_CODE_RSMA_REGEX_MATCH
;
terrno
=
TSDB_CODE_RSMA_REGEX_MATCH
;
...
@@ -150,7 +157,7 @@ static int32_t tdFetchQTaskInfoFiles(SSma *pSma, int64_t version, SArray **outpu
...
@@ -150,7 +157,7 @@ static int32_t tdFetchQTaskInfoFiles(SSma *pSma, int64_t version, SArray **outpu
if
(
!
(
pDir
=
taosOpenDir
(
dir
)))
{
if
(
!
(
pDir
=
taosOpenDir
(
dir
)))
{
regfree
(
&
regex
);
regfree
(
&
regex
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
sma
Debug
(
"vgId:%d, fetch qtask files, open dir %s failed since %s"
,
TD_VID
(
pVnode
),
dir
,
terrstr
());
sma
Error
(
"vgId:%d, fetch qtask files, open dir %s failed since %s"
,
TD_VID
(
pVnode
),
dir
,
terrstr
());
return
TSDB_CODE_FAILED
;
return
TSDB_CODE_FAILED
;
}
}
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
54562e24
...
@@ -1635,7 +1635,7 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) {
...
@@ -1635,7 +1635,7 @@ static void tdRSmaFetchTrigger(void *param, void *tmrId) {
atomic_val_compare_exchange_8
(
&
pItem
->
triggerStat
,
TASK_TRIGGER_STAT_ACTIVE
,
TASK_TRIGGER_STAT_INACTIVE
);
atomic_val_compare_exchange_8
(
&
pItem
->
triggerStat
,
TASK_TRIGGER_STAT_ACTIVE
,
TASK_TRIGGER_STAT_INACTIVE
);
switch
(
fetchTriggerStat
)
{
switch
(
fetchTriggerStat
)
{
case
TASK_TRIGGER_STAT_ACTIVE
:
{
case
TASK_TRIGGER_STAT_ACTIVE
:
{
sma
Info
(
"vgId:%d, rsma fetch task planned for level:%"
PRIi8
" suid:%"
PRIi64
" since stat is active"
,
sma
Debug
(
"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
// async process
pItem
->
fetchLevel
=
pItem
->
level
;
pItem
->
fetchLevel
=
pItem
->
level
;
...
@@ -1704,7 +1704,7 @@ static int32_t tdRSmaFetchAllResult(SSma *pSma, SRSmaInfo *pInfo) {
...
@@ -1704,7 +1704,7 @@ static int32_t tdRSmaFetchAllResult(SSma *pSma, SRSmaInfo *pInfo) {
SMA_VID
(
pSma
),
pInfo
->
suid
,
i
,
pItem
->
nSkipped
,
pItem
->
maxDelay
);
SMA_VID
(
pSma
),
pInfo
->
suid
,
i
,
pItem
->
nSkipped
,
pItem
->
maxDelay
);
}
else
if
(((
curMs
-
pInfo
->
lastRecv
)
<
RSMA_FETCH_ACTIVE_MAX
))
{
}
else
if
(((
curMs
-
pInfo
->
lastRecv
)
<
RSMA_FETCH_ACTIVE_MAX
))
{
++
pItem
->
nSkipped
;
++
pItem
->
nSkipped
;
sma
Info
(
"vgId:%d, suid:%"
PRIi64
" level:%"
PRIi8
" curMs:%"
PRIi64
" lastRecv:%"
PRIi64
", fetch skipped "
,
sma
Debug
(
"vgId:%d, suid:%"
PRIi64
" level:%"
PRIi8
" curMs:%"
PRIi64
" lastRecv:%"
PRIi64
", fetch skipped "
,
SMA_VID
(
pSma
),
pInfo
->
suid
,
i
,
curMs
,
pInfo
->
lastRecv
);
SMA_VID
(
pSma
),
pInfo
->
suid
,
i
,
curMs
,
pInfo
->
lastRecv
);
continue
;
continue
;
}
else
{
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录