Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
26778f29
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
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看板
提交
26778f29
编写于
11月 01, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: add config for persist wal at the beginning of vnodeCommit
上级
07db554f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
11 addition
and
5 deletion
+11
-5
include/common/tglobal.h
include/common/tglobal.h
+3
-0
include/libs/wal/wal.h
include/libs/wal/wal.h
+0
-1
source/common/src/tglobal.c
source/common/src/tglobal.c
+3
-0
source/libs/wal/src/walMeta.c
source/libs/wal/src/walMeta.c
+3
-3
source/libs/wal/src/walWrite.c
source/libs/wal/src/walWrite.c
+2
-1
未找到文件。
include/common/tglobal.h
浏览文件 @
26778f29
...
...
@@ -125,6 +125,9 @@ extern char tsSmlChildTableName[];
extern
char
tsSmlTagName
[];
extern
bool
tsSmlDataFormat
;
// wal
extern
int64_t
tsWalRecoverSizeLimit
;
// internal
extern
int32_t
tsTransPullupInterval
;
extern
int32_t
tsMqRebalanceInterval
;
...
...
include/libs/wal/wal.h
浏览文件 @
26778f29
...
...
@@ -43,7 +43,6 @@ extern "C" {
#define WAL_FILE_LEN (WAL_PATH_LEN + 32)
#define WAL_MAGIC 0xFAFBFCFDF4F3F2F1ULL
#define WAL_SCAN_BUF_SIZE (1024 * 1024 * 3)
#define WAL_RECOV_SIZE_LIMIT (200 * WAL_SCAN_BUF_SIZE)
typedef
enum
{
TAOS_WAL_WRITE
=
1
,
...
...
source/common/src/tglobal.c
浏览文件 @
26778f29
...
...
@@ -156,6 +156,9 @@ char tsCompressor[32] = "ZSTD_COMPRESSOR"; // ZSTD_COMPRESSOR or GZIP_COMPR
// udf
bool
tsStartUdfd
=
true
;
// wal
int64_t
tsWalRecoverSizeLimit
=
(
600
*
1024
*
1024L
);
// internal
int32_t
tsTransPullupInterval
=
2
;
int32_t
tsMqRebalanceInterval
=
2
;
...
...
source/libs/wal/src/walMeta.c
浏览文件 @
26778f29
...
...
@@ -18,6 +18,7 @@
#include "taoserror.h"
#include "tutil.h"
#include "walInt.h"
#include "tglobal.h"
bool
FORCE_INLINE
walLogExist
(
SWal
*
pWal
,
int64_t
ver
)
{
return
!
walIsEmpty
(
pWal
)
&&
walGetFirstVer
(
pWal
)
<=
ver
&&
walGetLastVer
(
pWal
)
>=
ver
;
...
...
@@ -82,11 +83,10 @@ static FORCE_INLINE int64_t walScanLogGetLastVer(SWal* pWal, int32_t fileIdx) {
readSize
=
end
-
offset
;
capacity
=
readSize
+
sizeof
(
magic
);
int64_t
limit
=
WAL_RECOV_SIZE_LIMIT
;
if
(
limit
<
readSize
)
{
if
(
tsWalRecoverSizeLimit
<
readSize
)
{
wError
(
"vgId:%d, possibly corrupted WAL range exceeds size limit (i.e. %"
PRId64
" bytes). offset:%"
PRId64
", end:%"
PRId64
", file:%s"
,
pWal
->
cfg
.
vgId
,
l
imit
,
offset
,
end
,
fnameStr
);
pWal
->
cfg
.
vgId
,
tsWalRecoverSizeL
imit
,
offset
,
end
,
fnameStr
);
terrno
=
TSDB_CODE_WAL_SIZE_LIMIT
;
goto
_err
;
}
...
...
source/libs/wal/src/walWrite.c
浏览文件 @
26778f29
...
...
@@ -16,6 +16,7 @@
#include "os.h"
#include "taoserror.h"
#include "tchecksum.h"
#include "tglobal.h"
#include "walInt.h"
int32_t
walRestoreFromSnapshot
(
SWal
*
pWal
,
int64_t
ver
)
{
...
...
@@ -252,7 +253,7 @@ static FORCE_INLINE int32_t walCheckAndRoll(SWal *pWal) {
}
}
if
(
walGetLastFileCachedSize
(
pWal
)
>
WAL_RECOV_SIZE_LIMIT
/
2
)
{
if
(
walGetLastFileCachedSize
(
pWal
)
>
tsWalRecoverSizeLimit
/
2
)
{
if
(
walSaveMeta
(
pWal
)
<
0
)
{
return
-
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录