Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f30d1eba
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22019
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看板
提交
f30d1eba
编写于
8月 18, 2023
作者:
B
Benguang Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: refactor func name as mndTransAppendPrepareLog
上级
9f1c8cc7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
11 addition
and
12 deletion
+11
-12
source/dnode/mnode/impl/inc/mndTrans.h
source/dnode/mnode/impl/inc/mndTrans.h
+3
-1
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+3
-4
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+4
-5
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+1
-2
未找到文件。
source/dnode/mnode/impl/inc/mndTrans.h
浏览文件 @
f30d1eba
...
...
@@ -66,11 +66,13 @@ void mndReleaseTrans(SMnode *pMnode, STrans *pTrans);
STrans
*
mndTransCreate
(
SMnode
*
pMnode
,
ETrnPolicy
policy
,
ETrnConflct
conflict
,
const
SRpcMsg
*
pReq
,
const
char
*
opername
);
void
mndTransDrop
(
STrans
*
pTrans
);
int32_t
mndTransAppendPrepareLog
(
STrans
*
pTrans
,
SSdbRaw
*
pRaw
);
int32_t
mndTransAppendRedolog
(
STrans
*
pTrans
,
SSdbRaw
*
pRaw
);
int32_t
mndTransAppendUndolog
(
STrans
*
pTrans
,
SSdbRaw
*
pRaw
);
int32_t
mndTransAppendCommitlog
(
STrans
*
pTrans
,
SSdbRaw
*
pRaw
);
int32_t
mndTransAppendNullLog
(
STrans
*
pTrans
);
int32_t
mndTransAppendPrepareAction
(
STrans
*
pTrans
,
STransAction
*
pAction
);
int32_t
mndTransAppendRedoAction
(
STrans
*
pTrans
,
STransAction
*
pAction
);
int32_t
mndTransAppendUndoAction
(
STrans
*
pTrans
,
STransAction
*
pAction
);
void
mndTransSetRpcRsp
(
STrans
*
pTrans
,
void
*
pCont
,
int32_t
contLen
);
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
f30d1eba
...
...
@@ -464,12 +464,11 @@ static void mndSetDefaultDbCfg(SDbCfg *pCfg) {
if
(
pCfg
->
tsdbPageSize
<=
0
)
pCfg
->
tsdbPageSize
=
TSDB_DEFAULT_TSDB_PAGESIZE
;
}
static
int32_t
mndSetCreateDbPrepareAction
s
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
)
{
static
int32_t
mndSetCreateDbPrepareAction
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
)
{
SSdbRaw
*
pDbRaw
=
mndDbActionEncode
(
pDb
);
if
(
pDbRaw
==
NULL
)
return
-
1
;
STransAction
action
=
{.
pRaw
=
pDbRaw
,
.
msgType
=
TDMT_MND_CREATE_DB
};
if
(
mndTransAppendPrepareAction
(
pTrans
,
&
action
)
!=
0
)
return
-
1
;
if
(
mndTransAppendPrepareLog
(
pTrans
,
pDbRaw
)
!=
0
)
return
-
1
;
if
(
sdbSetRawStatus
(
pDbRaw
,
SDB_STATUS_CREATING
)
!=
0
)
return
-
1
;
return
0
;
}
...
...
@@ -659,7 +658,7 @@ static int32_t mndCreateDb(SMnode *pMnode, SRpcMsg *pReq, SCreateDbReq *pCreate,
if
(
mndTransCheckConflict
(
pMnode
,
pTrans
)
!=
0
)
goto
_OVER
;
mndTransSetOper
(
pTrans
,
MND_OPER_CREATE_DB
);
if
(
mndSetCreateDbPrepareAction
s
(
pMnode
,
pTrans
,
&
dbObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateDbPrepareAction
(
pMnode
,
pTrans
,
&
dbObj
)
!=
0
)
goto
_OVER
;
if
(
mndSetNewVgPrepareActions
(
pMnode
,
pTrans
,
&
dbObj
,
pVgroups
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateDbRedoLogs
(
pMnode
,
pTrans
,
&
dbObj
,
pVgroups
)
!=
0
)
goto
_OVER
;
if
(
mndSetCreateDbUndoLogs
(
pMnode
,
pTrans
,
&
dbObj
,
pVgroups
)
!=
0
)
goto
_OVER
;
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
f30d1eba
...
...
@@ -655,11 +655,10 @@ int32_t mndTransAppendCommitlog(STrans *pTrans, SSdbRaw *pRaw) {
return
mndTransAppendAction
(
pTrans
->
commitActions
,
&
action
);
}
int32_t
mndTransAppendPrepareAction
(
STrans
*
pTrans
,
STransAction
*
pAction
)
{
pAction
->
stage
=
TRN_STAGE_PREPARE
;
pAction
->
actionType
=
TRANS_ACTION_RAW
;
pAction
->
mTraceId
=
pTrans
->
mTraceId
;
return
mndTransAppendAction
(
pTrans
->
prepareActions
,
pAction
);
int32_t
mndTransAppendPrepareLog
(
STrans
*
pTrans
,
SSdbRaw
*
pRaw
)
{
STransAction
action
=
{
.
pRaw
=
pRaw
,
.
stage
=
TRN_STAGE_PREPARE
,
.
actionType
=
TRANS_ACTION_RAW
,
.
mTraceId
=
pTrans
->
mTraceId
};
return
mndTransAppendAction
(
pTrans
->
prepareActions
,
&
action
);
}
int32_t
mndTransAppendRedoAction
(
STrans
*
pTrans
,
STransAction
*
pAction
)
{
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
f30d1eba
...
...
@@ -1276,8 +1276,7 @@ int32_t mndAddNewVgPrepareAction(SMnode *pMnode, STrans *pTrans, SVgObj *pVg) {
SSdbRaw
*
pRaw
=
mndVgroupActionEncode
(
pVg
);
if
(
pRaw
==
NULL
)
goto
_err
;
STransAction
action
=
{.
pRaw
=
pRaw
,
.
msgType
=
TDMT_MND_CREATE_VG
};
if
(
mndTransAppendPrepareAction
(
pTrans
,
&
action
)
!=
0
)
goto
_err
;
if
(
mndTransAppendPrepareLog
(
pTrans
,
pRaw
)
!=
0
)
goto
_err
;
(
void
)
sdbSetRawStatus
(
pRaw
,
SDB_STATUS_CREATING
);
pRaw
=
NULL
;
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录