Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8cd8f529
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8cd8f529
编写于
12月 20, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
8565cb4f
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
81 addition
and
81 deletion
+81
-81
include/common/taosmsg.h
include/common/taosmsg.h
+2
-2
include/dnode/vnode/vnode.h
include/dnode/vnode/vnode.h
+2
-2
source/dnode/mgmt/impl/src/dndVnodes.c
source/dnode/mgmt/impl/src/dndVnodes.c
+1
-1
source/dnode/mgmt/impl/test/db/db.cpp
source/dnode/mgmt/impl/test/db/db.cpp
+4
-4
source/dnode/mgmt/impl/test/stb/stb.cpp
source/dnode/mgmt/impl/test/stb/stb.cpp
+2
-2
source/dnode/mgmt/impl/test/vgroup/vgroup.cpp
source/dnode/mgmt/impl/test/vgroup/vgroup.cpp
+1
-1
source/dnode/mnode/impl/inc/mndTrans.h
source/dnode/mnode/impl/inc/mndTrans.h
+9
-2
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+49
-43
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+7
-20
source/libs/catalog/test/catalogTests.cpp
source/libs/catalog/test/catalogTests.cpp
+2
-2
source/libs/parser/src/astToMsg.c
source/libs/parser/src/astToMsg.c
+2
-2
未找到文件。
include/common/taosmsg.h
浏览文件 @
8cd8f529
...
...
@@ -589,8 +589,8 @@ typedef struct {
int32_t
daysToKeep0
;
int32_t
daysToKeep1
;
int32_t
daysToKeep2
;
int32_t
minRows
PerFileBlock
;
int32_t
maxRows
PerFileBlock
;
int32_t
minRows
;
int32_t
maxRows
;
int32_t
commitTime
;
int32_t
fsyncPeriod
;
int8_t
walLevel
;
...
...
include/dnode/vnode/vnode.h
浏览文件 @
8cd8f529
...
...
@@ -197,8 +197,8 @@ void *vnodeParseReq(void *buf, SVnodeReq *pReq, uint8_t type);
// int32_t daysToKeep0;
// int32_t daysToKeep1;
// int32_t daysToKeep2;
// int32_t minRows
PerFileBlock
;
// int32_t maxRows
PerFileBlock
;
// int32_t minRows;
// int32_t maxRows;
// int8_t precision; // time resolution
// int8_t compression;
// int8_t cacheLastRow;
...
...
source/dnode/mgmt/impl/src/dndVnodes.c
浏览文件 @
8cd8f529
...
...
@@ -683,7 +683,7 @@ static int32_t dndProcessDropVnodeReq(SDnode *pDnode, SRpcMsg *rpcMsg) {
SVnodeObj
*
pVnode
=
dndAcquireVnode
(
pDnode
,
vgId
);
if
(
pVnode
==
NULL
)
{
dDebug
(
"vgId:%d, failed to drop since %s"
,
vgId
,
terrstr
());
return
terrno
;
return
0
;
}
pVnode
->
dropped
=
1
;
...
...
source/dnode/mgmt/impl/test/db/db.cpp
浏览文件 @
8cd8f529
...
...
@@ -210,8 +210,8 @@ TEST_F(DndTestDb, 02_Create_Alter_Drop_Db) {
pReq
->
daysToKeep0
=
htonl
(
3650
);
pReq
->
daysToKeep1
=
htonl
(
3650
);
pReq
->
daysToKeep2
=
htonl
(
3650
);
pReq
->
minRows
PerFileBlock
=
htonl
(
100
);
pReq
->
maxRows
PerFileBlock
=
htonl
(
4096
);
pReq
->
minRows
=
htonl
(
100
);
pReq
->
maxRows
=
htonl
(
4096
);
pReq
->
commitTime
=
htonl
(
3600
);
pReq
->
fsyncPeriod
=
htonl
(
3000
);
pReq
->
walLevel
=
1
;
...
...
@@ -375,8 +375,8 @@ TEST_F(DndTestDb, 03_Create_Use_Restart_Use_Db) {
pReq
->
daysToKeep0
=
htonl
(
3650
);
pReq
->
daysToKeep1
=
htonl
(
3650
);
pReq
->
daysToKeep2
=
htonl
(
3650
);
pReq
->
minRows
PerFileBlock
=
htonl
(
100
);
pReq
->
maxRows
PerFileBlock
=
htonl
(
4096
);
pReq
->
minRows
=
htonl
(
100
);
pReq
->
maxRows
=
htonl
(
4096
);
pReq
->
commitTime
=
htonl
(
3600
);
pReq
->
fsyncPeriod
=
htonl
(
3000
);
pReq
->
walLevel
=
1
;
...
...
source/dnode/mgmt/impl/test/stb/stb.cpp
浏览文件 @
8cd8f529
...
...
@@ -187,8 +187,8 @@ TEST_F(DndTestStb, 01_Create_Show_Meta_Drop_Restart_Stb) {
pReq
->
daysToKeep0
=
htonl
(
3650
);
pReq
->
daysToKeep1
=
htonl
(
3650
);
pReq
->
daysToKeep2
=
htonl
(
3650
);
pReq
->
minRows
PerFileBlock
=
htonl
(
100
);
pReq
->
maxRows
PerFileBlock
=
htonl
(
4096
);
pReq
->
minRows
=
htonl
(
100
);
pReq
->
maxRows
=
htonl
(
4096
);
pReq
->
commitTime
=
htonl
(
3600
);
pReq
->
fsyncPeriod
=
htonl
(
3000
);
pReq
->
walLevel
=
1
;
...
...
source/dnode/mgmt/impl/test/vgroup/vgroup.cpp
浏览文件 @
8cd8f529
...
...
@@ -275,7 +275,7 @@ TEST_F(DndTestVgroup, 01_Create_Restart_Drop_Vnode) {
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
contLen
=
sizeof
(
S
Create
VnodeMsg
);
rpcMsg
.
contLen
=
sizeof
(
S
Drop
VnodeMsg
);
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_DROP_VNODE_IN
;
sendMsg
(
pClient
,
&
rpcMsg
);
...
...
source/dnode/mnode/impl/inc/mndTrans.h
浏览文件 @
8cd8f529
...
...
@@ -22,6 +22,13 @@
extern
"C"
{
#endif
typedef
struct
{
SEpSet
epSet
;
int8_t
msgType
;
int32_t
contLen
;
void
*
pCont
;
}
STransAction
;
int32_t
mndInitTrans
(
SMnode
*
pMnode
);
void
mndCleanupTrans
(
SMnode
*
pMnode
);
...
...
@@ -30,8 +37,8 @@ void mndTransDrop(STrans *pTrans);
int32_t
mndTransAppendRedolog
(
STrans
*
pTrans
,
SSdbRaw
*
pRaw
);
int32_t
mndTransAppendUndolog
(
STrans
*
pTrans
,
SSdbRaw
*
pRaw
);
int32_t
mndTransAppendCommitlog
(
STrans
*
pTrans
,
SSdbRaw
*
pRaw
);
int32_t
mndTransAppendRedoAction
(
STrans
*
pTrans
,
S
EpSet
*
pEpSet
,
int8_t
msgType
,
int32_t
contLen
,
void
*
pCont
);
int32_t
mndTransAppendUndoAction
(
STrans
*
pTrans
,
S
EpSet
*
pEpSet
,
int8_t
msgType
,
int32_t
contLen
,
void
*
pCont
);
int32_t
mndTransAppendRedoAction
(
STrans
*
pTrans
,
S
TransAction
*
pAction
);
int32_t
mndTransAppendUndoAction
(
STrans
*
pTrans
,
S
TransAction
*
pAction
);
int32_t
mndTransPrepare
(
SMnode
*
pMnode
,
STrans
*
pTrans
);
void
mndTransApply
(
SMnode
*
pMnode
,
SSdbRaw
*
pRaw
,
STransMsg
*
pMsg
,
int32_t
code
);
char
*
mndTransStageStr
(
ETrnStage
stage
);
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
8cd8f529
...
...
@@ -244,13 +244,15 @@ static void mndSetDefaultDbCfg(SDbCfg *pCfg) {
static
int32_t
mndSetRedoLogs
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroups
)
{
SSdbRaw
*
pDbRaw
=
mndDbActionEncode
(
pDb
);
if
(
pDbRaw
==
NULL
||
mndTransAppendRedolog
(
pTrans
,
pDbRaw
)
!=
0
)
return
-
1
;
sdbSetRawStatus
(
pDbRaw
,
SDB_STATUS_CREATING
);
if
(
pDbRaw
==
NULL
)
return
-
1
;
if
(
mndTransAppendRedolog
(
pTrans
,
pDbRaw
)
!=
0
)
return
-
1
;
if
(
sdbSetRawStatus
(
pDbRaw
,
SDB_STATUS_CREATING
)
!=
0
)
return
-
1
;
for
(
int
v
=
0
;
v
<
pDb
->
cfg
.
numOfVgroups
;
++
v
)
{
SSdbRaw
*
pVgRaw
=
mndVgroupActionEncode
(
pVgroups
+
v
);
if
(
pVgRaw
==
NULL
||
mndTransAppendRedolog
(
pTrans
,
pVgRaw
)
!=
0
)
return
-
1
;
sdbSetRawStatus
(
pVgRaw
,
SDB_STATUS_CREATING
);
if
(
pVgRaw
==
NULL
)
return
-
1
;
if
(
mndTransAppendRedolog
(
pTrans
,
pVgRaw
)
!=
0
)
return
-
1
;
if
(
sdbSetRawStatus
(
pVgRaw
,
SDB_STATUS_CREATING
)
!=
0
)
return
-
1
;
}
return
0
;
...
...
@@ -258,13 +260,15 @@ static int32_t mndSetRedoLogs(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgOb
static
int32_t
mndSetUndoLogs
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroups
)
{
SSdbRaw
*
pDbRaw
=
mndDbActionEncode
(
pDb
);
if
(
pDbRaw
==
NULL
||
mndTransAppendUndolog
(
pTrans
,
pDbRaw
)
!=
0
)
return
-
1
;
sdbSetRawStatus
(
pDbRaw
,
SDB_STATUS_DROPPED
);
if
(
pDbRaw
==
NULL
)
return
-
1
;
if
(
mndTransAppendUndolog
(
pTrans
,
pDbRaw
)
!=
0
)
return
-
1
;
if
(
sdbSetRawStatus
(
pDbRaw
,
SDB_STATUS_DROPPED
)
!=
0
)
return
-
1
;
for
(
int
v
=
0
;
v
<
pDb
->
cfg
.
numOfVgroups
;
++
v
)
{
SSdbRaw
*
pVgRaw
=
mndVgroupActionEncode
(
pVgroups
+
v
);
if
(
pVgRaw
==
NULL
||
mndTransAppendUndolog
(
pTrans
,
pVgRaw
)
!=
0
)
return
-
1
;
sdbSetRawStatus
(
pVgRaw
,
SDB_STATUS_DROPPED
);
if
(
pVgRaw
==
NULL
)
return
-
1
;
if
(
mndTransAppendUndolog
(
pTrans
,
pVgRaw
)
!=
0
)
return
-
1
;
if
(
sdbSetRawStatus
(
pVgRaw
,
SDB_STATUS_DROPPED
)
!=
0
)
return
-
1
;
}
return
0
;
...
...
@@ -272,38 +276,40 @@ static int32_t mndSetUndoLogs(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SVgOb
static
int32_t
mndSetCommitLogs
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroups
)
{
SSdbRaw
*
pDbRaw
=
mndDbActionEncode
(
pDb
);
if
(
pDbRaw
==
NULL
||
mndTransAppendCommitlog
(
pTrans
,
pDbRaw
)
!=
0
)
return
-
1
;
sdbSetRawStatus
(
pDbRaw
,
SDB_STATUS_READY
);
if
(
pDbRaw
==
NULL
)
return
-
1
;
if
(
mndTransAppendCommitlog
(
pTrans
,
pDbRaw
)
!=
0
)
return
-
1
;
if
(
sdbSetRawStatus
(
pDbRaw
,
SDB_STATUS_READY
)
!=
0
)
return
-
1
;
for
(
int
v
=
0
;
v
<
pDb
->
cfg
.
numOfVgroups
;
++
v
)
{
SSdbRaw
*
pVgRaw
=
mndVgroupActionEncode
(
pVgroups
+
v
);
if
(
pVgRaw
==
NULL
||
mndTransAppendCommitlog
(
pTrans
,
pVgRaw
)
!=
0
)
return
-
1
;
sdbSetRawStatus
(
pVgRaw
,
SDB_STATUS_READY
);
if
(
pVgRaw
==
NULL
)
return
-
1
;
if
(
mndTransAppendCommitlog
(
pTrans
,
pVgRaw
)
!=
0
)
return
-
1
;
if
(
sdbSetRawStatus
(
pVgRaw
,
SDB_STATUS_READY
)
!=
0
)
return
-
1
;
}
return
0
;
}
static
int32_t
mndSetRedoActions
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroups
)
{
for
(
int
v
=
0
;
v
<
pDb
->
cfg
.
numOfVgroups
;
++
v
)
{
SVgObj
*
pVgroup
=
pVgroups
+
v
;
for
(
int
v
g
=
0
;
vg
<
pDb
->
cfg
.
numOfVgroups
;
++
vg
)
{
SVgObj
*
pVgroup
=
pVgroups
+
v
g
;
for
(
int32_t
vn
=
0
;
vn
<
pVgroup
->
replica
;
++
vn
)
{
SVnodeGid
*
pVgid
=
pVgroup
->
vnodeGid
+
vn
;
SDnodeObj
*
pDnode
=
mndAcquireDnode
(
pMnode
,
pVgid
->
dnodeId
);
if
(
pDnode
==
NULL
)
{
return
-
1
;
}
STransAction
action
=
{
0
};
SVnodeGid
*
pVgid
=
pVgroup
->
vnodeGid
+
vn
;
SEpSet
epset
=
mndGetDnodeEpset
(
pDnode
);
SDnodeObj
*
pDnode
=
mndAcquireDnode
(
pMnode
,
pVgid
->
dnodeId
);
if
(
pDnode
==
NULL
)
return
-
1
;
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
mndReleaseDnode
(
pMnode
,
pDnode
);
SCreateVnodeMsg
*
pMsg
=
mndBuildCreateVnodeMsg
(
pMnode
,
pDnode
,
pDb
,
pVgroup
);
if
(
pMsg
==
NULL
)
{
return
-
1
;
}
if
(
pMsg
==
NULL
)
return
-
1
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
epset
,
TSDB_MSG_TYPE_ALTER_VNODE_IN
,
sizeof
(
SCreateVnodeMsg
),
pMsg
)
!=
0
)
{
action
.
pCont
=
pMsg
;
action
.
contLen
=
sizeof
(
SCreateVnodeMsg
);
action
.
msgType
=
TSDB_MSG_TYPE_ALTER_VNODE_IN
;
if
(
mndTransAppendRedoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pMsg
);
return
-
1
;
}
...
...
@@ -314,25 +320,25 @@ static int32_t mndSetRedoActions(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SV
}
static
int32_t
mndSetUndoActions
(
SMnode
*
pMnode
,
STrans
*
pTrans
,
SDbObj
*
pDb
,
SVgObj
*
pVgroups
)
{
for
(
int
v
=
0
;
v
<
pDb
->
cfg
.
numOfVgroups
;
++
v
)
{
SVgObj
*
pVgroup
=
pVgroups
+
v
;
for
(
int
v
g
=
0
;
vg
<
pDb
->
cfg
.
numOfVgroups
;
++
vg
)
{
SVgObj
*
pVgroup
=
pVgroups
+
v
g
;
for
(
int32_t
vn
=
0
;
vn
<
pVgroup
->
replica
;
++
vn
)
{
SVnodeGid
*
pVgid
=
pVgroup
->
vnodeGid
+
vn
;
SDnodeObj
*
pDnode
=
mndAcquireDnode
(
pMnode
,
pVgid
->
dnodeId
);
if
(
pDnode
==
NULL
)
{
return
-
1
;
}
STransAction
action
=
{
0
};
SVnodeGid
*
pVgid
=
pVgroup
->
vnodeGid
+
vn
;
SEpSet
epset
=
mndGetDnodeEpset
(
pDnode
);
SDnodeObj
*
pDnode
=
mndAcquireDnode
(
pMnode
,
pVgid
->
dnodeId
);
if
(
pDnode
==
NULL
)
return
-
1
;
action
.
epSet
=
mndGetDnodeEpset
(
pDnode
);
mndReleaseDnode
(
pMnode
,
pDnode
);
SDropVnodeMsg
*
pMsg
=
mndBuildDropVnodeMsg
(
pMnode
,
pDnode
,
pDb
,
pVgroup
);
if
(
pMsg
==
NULL
)
{
return
-
1
;
}
if
(
pMsg
==
NULL
)
return
-
1
;
if
(
mndTransAppendUndoAction
(
pTrans
,
&
epset
,
TSDB_MSG_TYPE_DROP_VNODE_IN
,
sizeof
(
SDropVnodeMsg
),
pMsg
)
!=
0
)
{
action
.
pCont
=
pMsg
;
action
.
contLen
=
sizeof
(
SDropVnodeMsg
);
action
.
msgType
=
TSDB_MSG_TYPE_DROP_VNODE_IN
;
if
(
mndTransAppendUndoAction
(
pTrans
,
&
action
)
!=
0
)
{
free
(
pMsg
);
return
-
1
;
}
...
...
@@ -344,14 +350,14 @@ static int32_t mndSetUndoActions(SMnode *pMnode, STrans *pTrans, SDbObj *pDb, SV
static
int32_t
mndCreateDb
(
SMnode
*
pMnode
,
SMnodeMsg
*
pMsg
,
SCreateDbMsg
*
pCreate
,
SUserObj
*
pUser
)
{
SDbObj
dbObj
=
{
0
};
tstrn
cpy
(
dbObj
.
name
,
pCreate
->
db
,
TSDB_FULL_DB_NAME_LEN
);
tstrn
cpy
(
dbObj
.
acct
,
pUser
->
acct
,
TSDB_USER_LEN
);
mem
cpy
(
dbObj
.
name
,
pCreate
->
db
,
TSDB_FULL_DB_NAME_LEN
);
mem
cpy
(
dbObj
.
acct
,
pUser
->
acct
,
TSDB_USER_LEN
);
dbObj
.
createdTime
=
taosGetTimestampMs
();
dbObj
.
updateTime
=
dbObj
.
createdTime
;
dbObj
.
uid
=
mndGenerateUid
(
dbObj
.
name
,
TSDB_FULL_DB_NAME_LEN
);
dbObj
.
hashMethod
=
1
;
dbObj
.
cfgVersion
=
1
;
dbObj
.
vgVersion
=
1
;
dbObj
.
hashMethod
=
1
;
dbObj
.
cfg
=
(
SDbCfg
){.
numOfVgroups
=
pCreate
->
numOfVgroups
,
.
cacheBlockSize
=
pCreate
->
cacheBlockSize
,
.
totalBlocks
=
pCreate
->
totalBlocks
,
...
...
@@ -359,8 +365,8 @@ static int32_t mndCreateDb(SMnode *pMnode, SMnodeMsg *pMsg, SCreateDbMsg *pCreat
.
daysToKeep0
=
pCreate
->
daysToKeep0
,
.
daysToKeep1
=
pCreate
->
daysToKeep1
,
.
daysToKeep2
=
pCreate
->
daysToKeep2
,
.
minRows
=
pCreate
->
minRows
PerFileBlock
,
.
maxRows
=
pCreate
->
maxRows
PerFileBlock
,
.
minRows
=
pCreate
->
minRows
,
.
maxRows
=
pCreate
->
maxRows
,
.
fsyncPeriod
=
pCreate
->
fsyncPeriod
,
.
commitTime
=
pCreate
->
commitTime
,
.
precision
=
pCreate
->
precision
,
...
...
@@ -447,8 +453,8 @@ static int32_t mndProcessCreateDbMsg(SMnodeMsg *pMsg) {
pCreate
->
daysToKeep0
=
htonl
(
pCreate
->
daysToKeep0
);
pCreate
->
daysToKeep1
=
htonl
(
pCreate
->
daysToKeep1
);
pCreate
->
daysToKeep2
=
htonl
(
pCreate
->
daysToKeep2
);
pCreate
->
minRows
PerFileBlock
=
htonl
(
pCreate
->
minRowsPerFileBlock
);
pCreate
->
maxRows
PerFileBlock
=
htonl
(
pCreate
->
maxRowsPerFileBlock
);
pCreate
->
minRows
=
htonl
(
pCreate
->
minRows
);
pCreate
->
maxRows
=
htonl
(
pCreate
->
maxRows
);
pCreate
->
commitTime
=
htonl
(
pCreate
->
commitTime
);
pCreate
->
fsyncPeriod
=
htonl
(
pCreate
->
fsyncPeriod
);
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
8cd8f529
...
...
@@ -21,13 +21,6 @@
#define TSDB_TRN_ARRAY_SIZE 8
#define TSDB_TRN_RESERVE_SIZE 64
typedef
struct
{
SEpSet
epSet
;
int8_t
msgType
;
int32_t
contLen
;
void
*
pCont
;
}
STransAction
;
static
SSdbRaw
*
mndTransActionEncode
(
STrans
*
pTrans
);
static
SSdbRow
*
mndTransActionDecode
(
SSdbRaw
*
pRaw
);
static
int32_t
mndTransActionInsert
(
SSdb
*
pSdb
,
STrans
*
pTrans
);
...
...
@@ -37,7 +30,7 @@ static int32_t mndTransActionDelete(SSdb *pSdb, STrans *pTrans);
static
void
mndTransSetRpcHandle
(
STrans
*
pTrans
,
void
*
rpcHandle
);
static
void
mndTransSendRpcRsp
(
STrans
*
pTrans
,
int32_t
code
);
static
int32_t
mndTransAppendLog
(
SArray
*
pArray
,
SSdbRaw
*
pRaw
);
static
int32_t
mndTransAppendAction
(
SArray
*
pArray
,
S
EpSet
*
pEpSet
,
int8_t
msgType
,
int32_t
contLen
,
void
*
pCont
);
static
int32_t
mndTransAppendAction
(
SArray
*
pArray
,
S
TransAction
*
pAction
);
static
void
mndTransDropLogs
(
SArray
*
pArray
);
static
void
mndTransDropActions
(
SArray
*
pArray
);
static
int32_t
mndTransExecuteLogs
(
SMnode
*
pMnode
,
SArray
*
pArray
);
...
...
@@ -459,10 +452,8 @@ int32_t mndTransAppendCommitlog(STrans *pTrans, SSdbRaw *pRaw) {
return
code
;
}
static
int32_t
mndTransAppendAction
(
SArray
*
pArray
,
SEpSet
*
pEpSet
,
int8_t
msgType
,
int32_t
contLen
,
void
*
pCont
)
{
STransAction
action
=
{.
epSet
=
*
pEpSet
,
.
msgType
=
msgType
,
.
contLen
=
contLen
,
.
pCont
=
pCont
};
void
*
ptr
=
taosArrayPush
(
pArray
,
&
action
);
static
int32_t
mndTransAppendAction
(
SArray
*
pArray
,
STransAction
*
pAction
)
{
void
*
ptr
=
taosArrayPush
(
pArray
,
&
pAction
);
if
(
ptr
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
...
...
@@ -471,16 +462,12 @@ static int32_t mndTransAppendAction(SArray *pArray, SEpSet *pEpSet, int8_t msgTy
return
0
;
}
int32_t
mndTransAppendRedoAction
(
STrans
*
pTrans
,
SEpSet
*
pEpSet
,
int8_t
msgType
,
int32_t
contLen
,
void
*
pCont
)
{
int32_t
code
=
mndTransAppendAction
(
pTrans
->
redoActions
,
pEpSet
,
msgType
,
contLen
,
pCont
);
mTrace
(
"trans:%d, msg:%s len:%d append to redo actions"
,
pTrans
->
id
,
taosMsg
[
msgType
],
contLen
);
return
code
;
int32_t
mndTransAppendRedoAction
(
STrans
*
pTrans
,
STransAction
*
pAction
)
{
return
mndTransAppendAction
(
pTrans
->
redoActions
,
pAction
);
}
int32_t
mndTransAppendUndoAction
(
STrans
*
pTrans
,
SEpSet
*
pEpSet
,
int8_t
msgType
,
int32_t
contLen
,
void
*
pCont
)
{
int32_t
code
=
mndTransAppendAction
(
pTrans
->
undoActions
,
pEpSet
,
msgType
,
contLen
,
pCont
);
mTrace
(
"trans:%d, msg:%s len:%d append to undo actions"
,
pTrans
->
id
,
taosMsg
[
msgType
],
contLen
);
return
code
;
int32_t
mndTransAppendUndoAction
(
STrans
*
pTrans
,
STransAction
*
pAction
)
{
return
mndTransAppendAction
(
pTrans
->
undoActions
,
pAction
);
}
int32_t
mndTransPrepare
(
SMnode
*
pMnode
,
STrans
*
pTrans
)
{
...
...
source/libs/catalog/test/catalogTests.cpp
浏览文件 @
8cd8f529
...
...
@@ -61,8 +61,8 @@ void sendCreateDbMsg(void *shandle, SEpSet *pEpSet) {
pReq
->
daysToKeep0
=
htonl
(
3650
);
pReq
->
daysToKeep1
=
htonl
(
3650
);
pReq
->
daysToKeep2
=
htonl
(
3650
);
pReq
->
minRows
PerFileBlock
=
htonl
(
100
);
pReq
->
maxRows
PerFileBlock
=
htonl
(
4096
);
pReq
->
minRows
=
htonl
(
100
);
pReq
->
maxRows
=
htonl
(
4096
);
pReq
->
commitTime
=
htonl
(
3600
);
pReq
->
fsyncPeriod
=
htonl
(
3000
);
pReq
->
walLevel
=
1
;
...
...
source/libs/parser/src/astToMsg.c
浏览文件 @
8cd8f529
...
...
@@ -116,8 +116,8 @@ static void doSetDbOptions(SCreateDbMsg* pMsg, const SCreateDbInfo* pCreateDb) {
pMsg
->
totalBlocks
=
htonl
(
pCreateDb
->
numOfBlocks
);
pMsg
->
daysPerFile
=
htonl
(
pCreateDb
->
daysPerFile
);
pMsg
->
commitTime
=
htonl
((
int32_t
)
pCreateDb
->
commitTime
);
pMsg
->
minRows
PerFileBlock
=
htonl
(
pCreateDb
->
minRowsPerBlock
);
pMsg
->
maxRows
PerFileBlock
=
htonl
(
pCreateDb
->
maxRowsPerBlock
);
pMsg
->
minRows
=
htonl
(
pCreateDb
->
minRowsPerBlock
);
pMsg
->
maxRows
=
htonl
(
pCreateDb
->
maxRowsPerBlock
);
pMsg
->
fsyncPeriod
=
htonl
(
pCreateDb
->
fsyncPeriod
);
pMsg
->
compression
=
pCreateDb
->
compressionLevel
;
pMsg
->
walLevel
=
(
char
)
pCreateDb
->
walLevel
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录