Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8fc5a0d6
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
8fc5a0d6
编写于
4月 04, 2023
作者:
A
Alex Duan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: add first ignore log
上级
31828ae3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
9 deletion
+30
-9
tests/system-test/0-others/walRetention.py
tests/system-test/0-others/walRetention.py
+30
-9
未找到文件。
tests/system-test/0-others/walRetention.py
浏览文件 @
8fc5a0d6
...
...
@@ -78,13 +78,16 @@ class WalFile:
# VNode object
class
VNode
:
# init
def
__init__
(
self
,
dnodeId
,
path
,
walPeriod
,
walSize
):
def
__init__
(
self
,
dnodeId
,
path
,
walPeriod
,
walSize
,
walStayRange
):
self
.
path
=
path
self
.
dnodeId
=
dnodeId
self
.
vgId
=
0
self
.
snapVer
=
0
self
.
firstVer
=
0
self
.
lastVer
=
-
1
self
.
walPeriod
=
walPeriod
self
.
walSize
=
walSize
self
.
walStayRange
=
walStayRange
self
.
walFiles
=
[]
self
.
load
(
path
)
...
...
@@ -108,7 +111,9 @@ class VNode :
if
metaFile
!=
""
:
jsonVer
=
jsonFromFile
(
metaFile
)
metaNode
=
jsonVer
[
"meta"
]
self
.
snapVer
=
int
(
metaNode
[
"snapshotVer"
])
self
.
snapVer
=
int
(
metaNode
[
"snapshotVer"
])
self
.
firstVer
=
int
(
metaNode
[
"firstVer"
])
self
.
lastVer
=
int
(
metaNode
[
"lastVer"
])
# sort with startVer
self
.
walFiles
=
sorted
(
self
.
walFiles
,
key
=
lambda
x
:
x
.
startVer
,
reverse
=
True
)
...
...
@@ -122,7 +127,7 @@ class VNode :
startVer
=
walFile
.
startVer
# print total
tdLog
.
info
(
f
" ---- dnode
{
self
.
dnodeId
}
snapVer=
{
self
.
snapVer
}
{
self
.
path
}
--------"
)
tdLog
.
info
(
f
" ---- dnode
{
self
.
dnodeId
}
snapVer=
{
self
.
snapVer
}
firstVer=
{
self
.
firstVer
}
lastVer=
{
self
.
lastVer
}
{
self
.
path
}
--------"
)
for
walFile
in
self
.
walFiles
:
mt
=
datetime
.
fromtimestamp
(
walFile
.
mtime
)
tdLog
.
info
(
f
"
{
walFile
.
pathFile
}
{
mt
}
startVer=
{
walFile
.
startVer
}
endVer=
{
walFile
.
endVer
}
"
)
...
...
@@ -132,10 +137,26 @@ class VNode :
if
walFile
.
endVer
==
-
1
:
# end file
return
False
# check snapVer
ret
=
False
if
self
.
snapVer
>
walFile
.
endVer
:
return
True
return
False
ret
=
True
# check stayRange
if
self
.
lastVer
!=
-
1
and
ret
:
# first wal file ignore
if
walFile
.
startVer
==
self
.
firstVer
:
tdLog
.
info
(
f
"
{
walFile
.
pathFile
}
can del, but is first. snapVer=
{
self
.
snapVer
}
firstVer=
{
self
.
firstVer
}
"
)
return
False
# ver in stay range
smallVer
=
self
.
snapVer
-
self
.
walStayRange
-
1
if
walFile
.
startVer
>=
smallVer
:
tdLog
.
info
(
f
"
{
walFile
.
pathFile
}
can del, but range not arrived. snapVer=
{
self
.
snapVer
}
smallVer=
{
smallVer
}
"
)
return
False
return
ret
# get log size
def
getWalsSize
(
self
):
...
...
@@ -341,7 +362,7 @@ class TDTestCase:
tdSql
.
execute
(
sql
)
#tdLog.info(sql)
def
check_retention
(
self
):
def
check_retention
(
self
,
walStayRange
):
# flash database
tdSql
.
execute
(
f
"flush database
{
self
.
dbname
}
"
)
time
.
sleep
(
0.5
)
...
...
@@ -359,7 +380,7 @@ class TDTestCase:
if
os
.
path
.
isdir
(
entryPath
):
if
path
.
exists
(
path
.
join
(
entryPath
,
"vnode.json"
)):
vnode
=
VNode
(
int
(
dnode
[
5
:]),
entryPath
,
self
.
wal_period
,
self
.
wal_size
)
vnode
=
VNode
(
int
(
dnode
[
5
:]),
entryPath
,
self
.
wal_period
,
self
.
wal_size
,
walStayRange
)
vnodes
.
append
(
vnode
)
# do check
...
...
@@ -423,7 +444,7 @@ class TDTestCase:
# check retention
tdLog
.
info
(
f
" -------------- do check retention ---------------"
)
self
.
check_retention
()
self
.
check_retention
(
walStayRange
=
256
)
# stop insert and wait exit
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录