Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a4adcbbe
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看板
提交
a4adcbbe
编写于
12月 04, 2022
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vnode/async-commit: adapter vnode-commit to use txn commit
上级
2a203472
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
11 deletion
+16
-11
source/dnode/vnode/src/inc/vnodeInt.h
source/dnode/vnode/src/inc/vnodeInt.h
+4
-2
source/dnode/vnode/src/meta/metaCommit.c
source/dnode/vnode/src/meta/metaCommit.c
+4
-3
source/dnode/vnode/src/meta/metaSnapshot.c
source/dnode/vnode/src/meta/metaSnapshot.c
+2
-2
source/dnode/vnode/src/vnd/vnodeCommit.c
source/dnode/vnode/src/vnd/vnodeCommit.c
+6
-4
未找到文件。
source/dnode/vnode/src/inc/vnodeInt.h
浏览文件 @
a4adcbbe
...
...
@@ -101,8 +101,9 @@ typedef struct STbUidStore STbUidStore;
int
metaOpen
(
SVnode
*
pVnode
,
SMeta
**
ppMeta
,
int8_t
rollback
);
int
metaClose
(
SMeta
*
pMeta
);
int
metaBegin
(
SMeta
*
pMeta
,
int8_t
fromSys
);
int
metaCommit
(
SMeta
*
pMeta
);
int
metaFinishCommit
(
SMeta
*
pMeta
);
TXN
*
metaGetTxn
(
SMeta
*
pMeta
);
int
metaCommit
(
SMeta
*
pMeta
,
TXN
*
txn
);
int
metaFinishCommit
(
SMeta
*
pMeta
,
TXN
*
txn
);
int
metaPrepareAsyncCommit
(
SMeta
*
pMeta
);
int
metaCreateSTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVCreateStbReq
*
pReq
);
int
metaAlterSTable
(
SMeta
*
pMeta
,
int64_t
version
,
SVCreateStbReq
*
pReq
);
...
...
@@ -411,6 +412,7 @@ struct SSnapDataHdr {
struct
SCommitInfo
{
SVnodeInfo
info
;
SVnode
*
pVnode
;
TXN
*
txn
;
};
#ifdef __cplusplus
...
...
source/dnode/vnode/src/meta/metaCommit.c
浏览文件 @
a4adcbbe
...
...
@@ -40,9 +40,10 @@ int metaBegin(SMeta *pMeta, int8_t fromSys) {
}
// commit the meta txn
int
metaCommit
(
SMeta
*
pMeta
)
{
return
tdbCommit
(
pMeta
->
pEnv
,
pMeta
->
txn
);
}
int
metaFinishCommit
(
SMeta
*
pMeta
)
{
return
tdbPostCommit
(
pMeta
->
pEnv
,
pMeta
->
txn
);
}
int
metaPrepareAsyncCommit
(
SMeta
*
pMeta
)
{
return
tdbPrepareAsyncCommit
(
pMeta
->
pEnv
,
pMeta
->
txn
);
}
TXN
*
metaGetTxn
(
SMeta
*
pMeta
)
{
return
pMeta
->
txn
;
}
int
metaCommit
(
SMeta
*
pMeta
,
TXN
*
txn
)
{
return
tdbCommit
(
pMeta
->
pEnv
,
txn
);
}
int
metaFinishCommit
(
SMeta
*
pMeta
,
TXN
*
txn
)
{
return
tdbPostCommit
(
pMeta
->
pEnv
,
txn
);
}
int
metaPrepareAsyncCommit
(
SMeta
*
pMeta
)
{
return
tdbPrepareAsyncCommit
(
pMeta
->
pEnv
,
pMeta
->
txn
);
}
// abort the meta txn
int
metaAbort
(
SMeta
*
pMeta
)
{
return
tdbAbort
(
pMeta
->
pEnv
,
pMeta
->
txn
);
}
source/dnode/vnode/src/meta/metaSnapshot.c
浏览文件 @
a4adcbbe
...
...
@@ -163,9 +163,9 @@ int32_t metaSnapWriterClose(SMetaSnapWriter** ppWriter, int8_t rollback) {
if
(
rollback
)
{
ASSERT
(
0
);
}
else
{
code
=
metaCommit
(
pWriter
->
pMeta
);
code
=
metaCommit
(
pWriter
->
pMeta
,
pWriter
->
pMeta
->
txn
);
if
(
code
)
goto
_err
;
code
=
metaFinishCommit
(
pWriter
->
pMeta
);
code
=
metaFinishCommit
(
pWriter
->
pMeta
,
pWriter
->
pMeta
->
txn
);
if
(
code
)
goto
_err
;
}
taosMemoryFree
(
pWriter
);
...
...
source/dnode/vnode/src/vnd/vnodeCommit.c
浏览文件 @
a4adcbbe
...
...
@@ -189,10 +189,11 @@ _err:
static
void
vnodePrepareCommit
(
SVnode
*
pVnode
)
{
tsem_wait
(
&
pVnode
->
canCommit
);
tsdbPrepareCommit
(
pVnode
->
pTsdb
);
metaPrepareAsyncCommit
(
pVnode
->
pMeta
);
vnodeBufPoolUnRef
(
pVnode
->
inUse
);
pVnode
->
inUse
=
NULL
;
tsdbPrepareCommit
(
pVnode
->
pTsdb
);
}
static
int32_t
vnodeCommitTask
(
void
*
arg
)
{
int32_t
code
=
0
;
...
...
@@ -229,6 +230,7 @@ int vnodeAsyncCommit(SVnode *pVnode) {
pInfo
->
info
.
state
.
commitTerm
=
pVnode
->
state
.
applyTerm
;
pInfo
->
info
.
state
.
commitID
=
pVnode
->
state
.
commitID
;
pInfo
->
pVnode
=
pVnode
;
pInfo
->
txn
=
metaGetTxn
(
pVnode
->
pMeta
);
vnodeScheduleTask
(
vnodeCommitTask
,
pInfo
);
_exit:
...
...
@@ -282,7 +284,7 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) {
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
// commit each sub-system
if
(
metaCommit
(
pVnode
->
pMeta
)
<
0
)
{
if
(
metaCommit
(
pVnode
->
pMeta
,
pInfo
->
txn
)
<
0
)
{
code
=
TSDB_CODE_FAILED
;
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
...
...
@@ -314,7 +316,7 @@ static int vnodeCommitImpl(SCommitInfo *pInfo) {
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
if
(
metaFinishCommit
(
pVnode
->
pMeta
)
<
0
)
{
if
(
metaFinishCommit
(
pVnode
->
pMeta
,
pInfo
->
txn
)
<
0
)
{
code
=
terrno
;
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录