Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8df67a9a
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
8df67a9a
编写于
2月 07, 2023
作者:
K
kailixu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: rsma close and commit
上级
9598fe68
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
13 deletion
+13
-13
source/dnode/vnode/src/sma/smaCommit.c
source/dnode/vnode/src/sma/smaCommit.c
+13
-13
未找到文件。
source/dnode/vnode/src/sma/smaCommit.c
浏览文件 @
8df67a9a
...
...
@@ -130,6 +130,7 @@ _exit:
* 2) Wait all running fetch task finish to fetch and put submitMsg into level 2/3 wQueue(blocking level 1 write)
*
* @param pSma
* @param isCommit
* @return int32_t
*/
static
int32_t
tdProcessRSmaAsyncPreCommitImpl
(
SSma
*
pSma
,
bool
isCommit
)
{
...
...
@@ -155,23 +156,22 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma, bool isCommit) {
nLoops
=
0
;
}
}
}
pRSmaStat
->
commitAppliedVer
=
pSma
->
pVnode
->
state
.
applied
;
if
(
ASSERTS
(
pRSmaStat
->
commitAppliedVer
>=
-
1
,
"commit applied version %"
PRIi64
" < 0"
,
pRSmaStat
->
commitAppliedVer
))
{
code
=
TSDB_CODE_APP_ERROR
;
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
pRSmaStat
->
commitAppliedVer
=
pSma
->
pVnode
->
state
.
applied
;
if
(
ASSERTS
(
pRSmaStat
->
commitAppliedVer
>=
-
1
,
"commit applied version %"
PRIi64
" < -1"
,
pRSmaStat
->
commitAppliedVer
))
{
code
=
TSDB_CODE_APP_ERROR
;
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
}
// step 2: wait for all triggered fetch tasks to finish
nLoops
=
0
;
while
(
1
)
{
if
(
atomic_load_32
(
&
pRSmaStat
->
nFetchAll
)
<=
0
)
{
smaDebug
(
"vgId:%d, rsma commit
, fetch tasks are all finished"
,
SMA_VID
(
pSma
)
);
smaDebug
(
"vgId:%d, rsma commit
:%d, fetch tasks are all finished"
,
SMA_VID
(
pSma
),
isCommit
);
break
;
}
else
{
smaDebug
(
"vgId:%d, rsma commit
, fetch tasks are not all finished yet"
,
SMA_VID
(
pSma
)
);
smaDebug
(
"vgId:%d, rsma commit
%d, fetch tasks are not all finished yet"
,
SMA_VID
(
pSma
),
isCommit
);
}
++
nLoops
;
if
(
nLoops
>
1000
)
{
...
...
@@ -185,7 +185,7 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma, bool isCommit) {
* 1) This is high cost task and should not put in asyncPreCommit originally.
* 2) But, if put in asyncCommit, would trigger taskInfo cloning frequently.
*/
smaInfo
(
"vgId:%d, rsma commit
, wait for all items to be consumed, TID:%p"
,
SMA_VID
(
pSma
)
,
smaInfo
(
"vgId:%d, rsma commit
:%d, wait for all items to be consumed, TID:%p"
,
SMA_VID
(
pSma
),
isCommit
,
(
void
*
)
taosGetSelfPthreadId
());
nLoops
=
0
;
while
(
atomic_load_64
(
&
pRSmaStat
->
nBufItems
)
>
0
)
{
...
...
@@ -201,7 +201,7 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma, bool isCommit) {
smaInfo
(
"vgId:%d, rsma commit, all items are consumed, TID:%p"
,
SMA_VID
(
pSma
),
(
void
*
)
taosGetSelfPthreadId
());
code
=
tdRSmaPersistExecImpl
(
pRSmaStat
,
RSMA_INFO_HASH
(
pRSmaStat
));
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
smaInfo
(
"vgId:%d, rsma commit, operator state committed, TID:%p"
,
SMA_VID
(
pSma
),
(
void
*
)
taosGetSelfPthreadId
());
#if 0 // consuming task of qTaskInfo clone
...
...
@@ -237,7 +237,7 @@ static int32_t tdProcessRSmaAsyncPreCommitImpl(SSma *pSma, bool isCommit) {
_exit:
if
(
code
)
{
smaError
(
"vgId:%d, %s failed at line %d since %s
"
,
SMA_VID
(
pSma
),
__func__
,
lino
,
tstrerror
(
code
)
);
smaError
(
"vgId:%d, %s failed at line %d since %s
(%d)"
,
SMA_VID
(
pSma
),
__func__
,
lino
,
tstrerror
(
code
),
isCommit
);
}
return
code
;
}
...
...
@@ -257,7 +257,7 @@ static int32_t tdProcessRSmaAsyncCommitImpl(SSma *pSma, SCommitInfo *pInfo) {
if
(
!
pSmaEnv
)
{
goto
_exit
;
}
code
=
tdRSmaFSCommit
(
pSma
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录