Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3e2c24d9
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,发现更多精彩内容 >>
提交
3e2c24d9
编写于
7月 27, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
other: add debug logs
上级
b5c6d563
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
11 addition
and
4 deletion
+11
-4
source/libs/wal/src/walWrite.c
source/libs/wal/src/walWrite.c
+7
-0
tests/script/tsim/sync/vnodesnapshot-test.sim
tests/script/tsim/sync/vnodesnapshot-test.sim
+4
-4
未找到文件。
source/libs/wal/src/walWrite.c
浏览文件 @
3e2c24d9
...
@@ -250,11 +250,13 @@ int32_t walBeginSnapshot(SWal *pWal, int64_t ver) {
...
@@ -250,11 +250,13 @@ int32_t walBeginSnapshot(SWal *pWal, int64_t ver) {
}
}
int32_t
walEndSnapshot
(
SWal
*
pWal
)
{
int32_t
walEndSnapshot
(
SWal
*
pWal
)
{
uInfo
(
"%s:%d rsma: WAL walEndSnapshot entry for %s"
,
__func__
,
__LINE__
,
pWal
->
path
);
int32_t
code
=
0
;
int32_t
code
=
0
;
taosThreadMutexLock
(
&
pWal
->
mutex
);
taosThreadMutexLock
(
&
pWal
->
mutex
);
int64_t
ver
=
pWal
->
vers
.
verInSnapshotting
;
int64_t
ver
=
pWal
->
vers
.
verInSnapshotting
;
if
(
ver
==
-
1
)
{
if
(
ver
==
-
1
)
{
code
=
-
1
;
code
=
-
1
;
uInfo
(
"%s:%d rsma: WAL walEndSnapshot code = -1 for %s"
,
__func__
,
__LINE__
,
pWal
->
path
);
goto
END
;
goto
END
;
};
};
...
@@ -291,12 +293,15 @@ int32_t walEndSnapshot(SWal *pWal) {
...
@@ -291,12 +293,15 @@ int32_t walEndSnapshot(SWal *pWal) {
}
}
char
fnameStr
[
WAL_FILE_LEN
];
char
fnameStr
[
WAL_FILE_LEN
];
// remove file
// remove file
uInfo
(
"%s:%d rsma: WAL walEndSnapshot deleteCnt=%d %s"
,
__func__
,
__LINE__
,
(
int32_t
)
deleteCnt
,
pWal
->
path
);
for
(
int
i
=
0
;
i
<
deleteCnt
;
i
++
)
{
for
(
int
i
=
0
;
i
<
deleteCnt
;
i
++
)
{
pInfo
=
taosArrayGet
(
pWal
->
fileInfoSet
,
i
);
pInfo
=
taosArrayGet
(
pWal
->
fileInfoSet
,
i
);
walBuildLogName
(
pWal
,
pInfo
->
firstVer
,
fnameStr
);
walBuildLogName
(
pWal
,
pInfo
->
firstVer
,
fnameStr
);
taosRemoveFile
(
fnameStr
);
taosRemoveFile
(
fnameStr
);
uInfo
(
"rsma: removed WAL log file %s"
,
fnameStr
);
walBuildIdxName
(
pWal
,
pInfo
->
firstVer
,
fnameStr
);
walBuildIdxName
(
pWal
,
pInfo
->
firstVer
,
fnameStr
);
taosRemoveFile
(
fnameStr
);
taosRemoveFile
(
fnameStr
);
uInfo
(
"rsma: removed WAL idx file %s"
,
fnameStr
);
}
}
// make new array, remove files
// make new array, remove files
...
@@ -307,6 +312,8 @@ int32_t walEndSnapshot(SWal *pWal) {
...
@@ -307,6 +312,8 @@ int32_t walEndSnapshot(SWal *pWal) {
}
else
{
}
else
{
pWal
->
vers
.
firstVer
=
((
SWalFileInfo
*
)
taosArrayGet
(
pWal
->
fileInfoSet
,
0
))
->
firstVer
;
pWal
->
vers
.
firstVer
=
((
SWalFileInfo
*
)
taosArrayGet
(
pWal
->
fileInfoSet
,
0
))
->
firstVer
;
}
}
}
else
{
uInfo
(
"%s:%d rsma: WAL walEndSnapshot %s"
,
__func__
,
__LINE__
,
pWal
->
path
);
}
}
pWal
->
writeCur
=
taosArrayGetSize
(
pWal
->
fileInfoSet
)
-
1
;
pWal
->
writeCur
=
taosArrayGetSize
(
pWal
->
fileInfoSet
)
-
1
;
pWal
->
totSize
=
newTotSize
;
pWal
->
totSize
=
newTotSize
;
...
...
tests/script/tsim/sync/vnodesnapshot-test.sim
浏览文件 @
3e2c24d9
...
@@ -49,7 +49,7 @@ $replica = 3
...
@@ -49,7 +49,7 @@ $replica = 3
$vgroups = 1
$vgroups = 1
print ============= create database
print ============= create database
sql create database db replica $replica vgroups $vgroups
sql create database db replica $replica vgroups $vgroups
retentions 3s:7d,5s:21d,15s:365d
$loop_cnt = 0
$loop_cnt = 0
check_db_ready:
check_db_ready:
...
@@ -113,7 +113,7 @@ endi
...
@@ -113,7 +113,7 @@ endi
vg_ready:
vg_ready:
print ====> create stable/child table
print ====> create stable/child table
sql create table stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int)
sql create table stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int)
rollup(max)
sql show stables
sql show stables
if $rows != 1 then
if $rows != 1 then
...
@@ -132,7 +132,7 @@ print ===> write 100 records
...
@@ -132,7 +132,7 @@ print ===> write 100 records
$N = 100
$N = 100
$count = 0
$count = 0
while $count < $N
while $count < $N
$ms = 1
591200
000000 + $count
$ms = 1
658924
000000 + $count
sql insert into ct1 values( $ms , $count , 2.1, 3.1)
sql insert into ct1 values( $ms , $count , 2.1, 3.1)
$count = $count + 1
$count = $count + 1
endw
endw
...
@@ -149,7 +149,7 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
...
@@ -149,7 +149,7 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
sleep 10000
########################################################
########################################################
print ===> start dnode1 dnode2 dnode3 dnode4
print ===> start dnode1 dnode2 dnode3 dnode4
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录