Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
53def5b7
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
53def5b7
编写于
5月 30, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: make trans support multi steps
上级
536ea7b9
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
293 addition
and
346 deletion
+293
-346
include/util/tdef.h
include/util/tdef.h
+1
-0
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+9
-11
source/dnode/mnode/impl/inc/mndTrans.h
source/dnode/mnode/impl/inc/mndTrans.h
+13
-21
source/dnode/mnode/impl/src/mndSubscribe.c
source/dnode/mnode/impl/src/mndSubscribe.c
+1
-1
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+268
-310
tests/test/c/sdbDump.c
tests/test/c/sdbDump.c
+1
-3
未找到文件。
include/util/tdef.h
浏览文件 @
53def5b7
...
...
@@ -254,6 +254,7 @@ typedef enum ELogicConditionType {
#define TSDB_TRANS_STAGE_LEN 12
#define TSDB_TRANS_TYPE_LEN 16
#define TSDB_TRANS_ERROR_LEN 64
#define TSDB_TRANS_DESC_LEN 128
#define TSDB_STEP_NAME_LEN 32
#define TSDB_STEP_DESC_LEN 128
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
53def5b7
...
...
@@ -60,14 +60,12 @@ typedef enum {
typedef
enum
{
TRN_STAGE_PREPARE
=
0
,
TRN_STAGE_REDO_LOG
=
1
,
TRN_STAGE_REDO_ACTION
=
2
,
TRN_STAGE_ROLLBACK
=
3
,
TRN_STAGE_UNDO_ACTION
=
4
,
TRN_STAGE_UNDO_LOG
=
5
,
TRN_STAGE_COMMIT
=
6
,
TRN_STAGE_COMMIT_LOG
=
7
,
TRN_STAGE_FINISHED
=
8
TRN_STAGE_REDO_ACTION
=
1
,
TRN_STAGE_ROLLBACK
=
2
,
TRN_STAGE_UNDO_ACTION
=
3
,
TRN_STAGE_COMMIT
=
4
,
TRN_STAGE_COMMIT_ACTION
=
5
,
TRN_STAGE_FINISHED
=
6
}
ETrnStage
;
typedef
enum
{
...
...
@@ -168,16 +166,16 @@ typedef struct {
SRpcHandleInfo
rpcInfo
;
void
*
rpcRsp
;
int32_t
rpcRspLen
;
SArray
*
redoLogs
;
SArray
*
undoLogs
;
SArray
*
commitLogs
;
int32_t
redoActionPos
;
SArray
*
redoActions
;
SArray
*
undoActions
;
SArray
*
commitActions
;
int64_t
createdTime
;
int64_t
lastExecTime
;
int64_t
dbUid
;
char
dbname
[
TSDB_DB_FNAME_LEN
];
char
lastError
[
TSDB_TRANS_ERROR_LEN
];
char
desc
[
TSDB_TRANS_DESC_LEN
];
int32_t
startFunc
;
int32_t
stopFunc
;
int32_t
paramLen
;
...
...
source/dnode/mnode/impl/inc/mndTrans.h
浏览文件 @
53def5b7
...
...
@@ -26,31 +26,23 @@ typedef enum {
TRANS_START_FUNC_TEST
=
1
,
TRANS_STOP_FUNC_TEST
=
2
,
TRANS_START_FUNC_MQ_REB
=
3
,
TRANS_STOP_FUNC_
TEST_
MQ_REB
=
4
,
TRANS_STOP_FUNC_MQ_REB
=
4
,
}
ETrnFunc
;
typedef
struct
{
SEpSet
epSet
;
tmsg_t
msgType
;
int8_t
msgSent
;
int8_t
msgReceived
;
int32_t
errCode
;
int32_t
acceptableCode
;
int32_t
contLen
;
void
*
pCont
;
}
STransAction
;
typedef
struct
{
int32_t
id
;
tmsg_t
msgType
;
int8_t
msgSent
;
int8_t
msgReceived
;
int8_t
isRaw
;
int8_t
rawWritten
;
SSdbRaw
*
pRaw
;
}
STransLog
;
typedef
struct
{
ETrnStep
stepType
;
STransAction
redoAction
;
STransAction
undoAction
;
STransLog
redoLog
;
STransLog
undoLog
;
}
STransStep
;
SEpSet
epSet
;
int32_t
errCode
;
int32_t
acceptableCode
;
int32_t
contLen
;
void
*
pCont
;
}
STransAction
;
typedef
void
(
*
TransCbFp
)(
SMnode
*
pMnode
,
void
*
param
,
int32_t
paramLen
);
...
...
source/dnode/mnode/impl/src/mndSubscribe.c
浏览文件 @
53def5b7
...
...
@@ -493,7 +493,7 @@ static int32_t mndPersistRebResult(SMnode *pMnode, SRpcMsg *pMsg, const SMqRebOu
// 4. TODO commit log: modification log
// 5. set cb
mndTransSetCb
(
pTrans
,
TRANS_START_FUNC_MQ_REB
,
TRANS_STOP_FUNC_
TEST_
MQ_REB
,
NULL
,
0
);
mndTransSetCb
(
pTrans
,
TRANS_START_FUNC_MQ_REB
,
TRANS_STOP_FUNC_MQ_REB
,
NULL
,
0
);
// 6. execution
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
!=
0
)
goto
REB_FAIL
;
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
53def5b7
此差异已折叠。
点击以展开。
tests/test/c/sdbDump.c
浏览文件 @
53def5b7
...
...
@@ -283,9 +283,7 @@ void dumpTrans(SSdb *pSdb, SJson *json) {
tjsonAddStringToObject
(
item
,
"createdTime"
,
i642str
(
pObj
->
createdTime
));
tjsonAddStringToObject
(
item
,
"dbUid"
,
i642str
(
pObj
->
dbUid
));
tjsonAddStringToObject
(
item
,
"dbname"
,
pObj
->
dbname
);
tjsonAddIntegerToObject
(
item
,
"redoLogNum"
,
taosArrayGetSize
(
pObj
->
redoLogs
));
tjsonAddIntegerToObject
(
item
,
"undoLogNum"
,
taosArrayGetSize
(
pObj
->
undoLogs
));
tjsonAddIntegerToObject
(
item
,
"commitLogNum"
,
taosArrayGetSize
(
pObj
->
commitLogs
));
tjsonAddIntegerToObject
(
item
,
"commitLogNum"
,
taosArrayGetSize
(
pObj
->
commitActions
));
tjsonAddIntegerToObject
(
item
,
"redoActionNum"
,
taosArrayGetSize
(
pObj
->
redoActions
));
tjsonAddIntegerToObject
(
item
,
"undoActionNum"
,
taosArrayGetSize
(
pObj
->
undoActions
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录