Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7af1fccb
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看板
未验证
提交
7af1fccb
编写于
5月 30, 2021
作者:
S
Shengliang Guan
提交者:
GitHub
5月 30, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6284 from taosdata/feature/TD-1920
[TD-1920]load mininal modules,and disable sync wal when compact mnode wal
上级
32fba9d0
6f7a349f
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
34 addition
and
9 deletion
+34
-9
src/dnode/src/dnodeMain.c
src/dnode/src/dnodeMain.c
+25
-4
src/mnode/src/mnodeMain.c
src/mnode/src/mnodeMain.c
+1
-1
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+4
-2
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+2
-2
src/wal/src/walWrite.c
src/wal/src/walWrite.c
+2
-0
未找到文件。
src/dnode/src/dnodeMain.c
浏览文件 @
7af1fccb
...
...
@@ -86,6 +86,17 @@ static SStep tsDnodeSteps[] = {
{
"dnode-telemetry"
,
dnodeInitTelemetry
,
dnodeCleanupTelemetry
},
};
static
SStep
tsDnodeCompactSteps
[]
=
{
{
"dnode-tfile"
,
tfInit
,
tfCleanup
},
{
"dnode-storage"
,
dnodeInitStorage
,
dnodeCleanupStorage
},
{
"dnode-eps"
,
dnodeInitEps
,
dnodeCleanupEps
},
{
"dnode-wal"
,
walInit
,
walCleanUp
},
{
"dnode-mread"
,
dnodeInitMRead
,
NULL
},
{
"dnode-mwrite"
,
dnodeInitMWrite
,
NULL
},
{
"dnode-mpeer"
,
dnodeInitMPeer
,
NULL
},
{
"dnode-modules"
,
dnodeInitModules
,
dnodeCleanupModules
},
};
static
int
dnodeCreateDir
(
const
char
*
dir
)
{
if
(
mkdir
(
dir
,
0755
)
!=
0
&&
errno
!=
EEXIST
)
{
return
-
1
;
...
...
@@ -95,13 +106,23 @@ static int dnodeCreateDir(const char *dir) {
}
static
void
dnodeCleanupComponents
()
{
if
(
!
tsCompactMnodeWal
)
{
int32_t
stepSize
=
sizeof
(
tsDnodeSteps
)
/
sizeof
(
SStep
);
dnodeStepCleanup
(
tsDnodeSteps
,
stepSize
);
}
else
{
int32_t
stepSize
=
sizeof
(
tsDnodeCompactSteps
)
/
sizeof
(
SStep
);
dnodeStepCleanup
(
tsDnodeCompactSteps
,
stepSize
);
}
}
static
int32_t
dnodeInitComponents
()
{
if
(
!
tsCompactMnodeWal
)
{
int32_t
stepSize
=
sizeof
(
tsDnodeSteps
)
/
sizeof
(
SStep
);
return
dnodeStepInit
(
tsDnodeSteps
,
stepSize
);
}
else
{
int32_t
stepSize
=
sizeof
(
tsDnodeCompactSteps
)
/
sizeof
(
SStep
);
return
dnodeStepInit
(
tsDnodeCompactSteps
,
stepSize
);
}
}
static
int32_t
dnodeInitTmr
()
{
...
...
src/mnode/src/mnodeMain.c
浏览文件 @
7af1fccb
...
...
@@ -121,7 +121,7 @@ int32_t mnodeStartSystem() {
int32_t
mnodeInitSystem
()
{
mnodeInitTimer
();
if
(
mnodeNeedStart
())
{
if
(
mnodeNeedStart
()
||
tsCompactMnodeWal
)
{
return
mnodeStartSystem
();
}
return
0
;
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
7af1fccb
...
...
@@ -690,7 +690,7 @@ static int32_t sdbProcessWrite(void *wparam, void *hparam, int32_t qtype, void *
pthread_mutex_unlock
(
&
tsSdbMgmt
.
mutex
);
// from app, row is created
if
(
pRow
!=
NULL
)
{
if
(
pRow
!=
NULL
&&
tsCompactMnodeWal
!=
1
)
{
// forward to peers
pRow
->
processedCount
=
0
;
int32_t
syncCode
=
syncForwardToPeer
(
tsSdbMgmt
.
sync
,
pHead
,
pRow
,
TAOS_QTYPE_RPC
,
false
);
...
...
@@ -713,7 +713,9 @@ static int32_t sdbProcessWrite(void *wparam, void *hparam, int32_t qtype, void *
actStr
[
action
],
sdbGetKeyStr
(
pTable
,
pHead
->
cont
),
pHead
->
version
);
// even it is WAL/FWD, it shall be called to update version in sync
if
(
tsCompactMnodeWal
!=
1
)
{
syncForwardToPeer
(
tsSdbMgmt
.
sync
,
pHead
,
pRow
,
TAOS_QTYPE_RPC
,
false
);
}
// from wal or forward msg, row not created, should add into hash
if
(
action
==
SDB_ACTION_INSERT
)
{
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
7af1fccb
...
...
@@ -3375,7 +3375,7 @@ static int32_t mnodeCompactSuperTables() {
.
rowSize
=
sizeof
(
SSTableObj
)
+
schemaSize
,
};
mInfo
(
"compact super %"
PRIu64
,
pTable
->
uid
);
//
mInfo("compact super %" PRIu64, pTable->uid);
sdbInsertCompactRow
(
&
row
);
}
...
...
@@ -3401,7 +3401,7 @@ static int32_t mnodeCompactChildTables() {
.
pTable
=
tsChildTableSdb
,
};
mInfo
(
"compact child %"
PRIu64
":%d"
,
pTable
->
uid
,
pTable
->
tid
);
//
mInfo("compact child %" PRIu64 ":%d", pTable->uid, pTable->tid);
sdbInsertCompactRow
(
&
row
);
}
...
...
src/wal/src/walWrite.c
浏览文件 @
7af1fccb
...
...
@@ -430,6 +430,8 @@ static int32_t walRestoreWalFile(SWal *pWal, void *pVnode, FWalWrite writeFp, ch
pWal
->
vgId
,
fileId
,
pHead
->
version
,
pWal
->
version
,
pHead
->
len
,
offset
);
pWal
->
version
=
pHead
->
version
;
//wInfo("writeFp: %ld", offset);
(
*
writeFp
)(
pVnode
,
pHead
,
TAOS_QTYPE_WAL
,
NULL
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录