Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f1e28fb8
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看板
提交
f1e28fb8
编写于
7月 27, 2022
作者:
W
wenzhouwww@live.cn
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update case
上级
9cb3f9b3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
18 deletion
+21
-18
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_sync.py
...de1mnode_basic_replica3_insertdatas_stop_follower_sync.py
+11
-10
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_unsync.py
...1mnode_basic_replica3_insertdatas_stop_follower_unsync.py
+10
-8
未找到文件。
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_sync.py
浏览文件 @
f1e28fb8
...
...
@@ -221,7 +221,7 @@ class TDTestCase:
tdLog
.
debug
(
" ==== check insert tbnames first failed , this is {}_th retry check tbnames of database {}"
.
format
(
count
,
dbname
))
count
+=
1
def
_get_stop_dnode_id
(
self
,
dbname
,
role
):
def
_get_stop_dnode_id
(
self
,
dbname
,
dnode_
role
):
tdSql
.
query
(
"show {}.vgroups"
.
format
(
dbname
))
vgroup_infos
=
tdSql
.
queryResult
...
...
@@ -229,7 +229,7 @@ class TDTestCase:
leader_infos
=
vgroup_info
[
3
:
-
4
]
# print(vgroup_info)
for
ind
,
role
in
enumerate
(
leader_infos
):
if
role
==
role
:
if
dnode_
role
==
role
:
# print(ind,leader_infos)
self
.
stop_dnode_id
=
leader_infos
[
ind
-
1
]
break
...
...
@@ -237,10 +237,10 @@ class TDTestCase:
return
self
.
stop_dnode_id
def
wait_stop_dnode_OK
(
self
):
def
wait_stop_dnode_OK
(
self
,
newTdSql
):
def
_get_status
():
newTdSql
=
tdCom
.
newTdSql
()
#
newTdSql=tdCom.newTdSql()
status
=
""
newTdSql
.
query
(
"show dnodes"
)
...
...
@@ -260,10 +260,10 @@ class TDTestCase:
# tdLog.notice("==== stop dnode has not been stopped , endpoint is {}".format(self.stop_dnode))
tdLog
.
notice
(
"==== stop_dnode has stopped , id is {} ===="
.
format
(
self
.
stop_dnode_id
))
def
wait_start_dnode_OK
(
self
):
def
wait_start_dnode_OK
(
self
,
newTdSql
):
def
_get_status
():
newTdSql
=
tdCom
.
newTdSql
()
#
newTdSql=tdCom.newTdSql()
status
=
""
newTdSql
.
query
(
"show dnodes"
)
dnode_infos
=
newTdSql
.
queryResult
...
...
@@ -371,12 +371,13 @@ class TDTestCase:
def
sync_run_case
(
self
):
# stop follower and insert datas , update tables and create new stables
tdDnodes
=
cluster
.
dnodes
newTdSql
=
tdCom
.
newTdSql
()
for
loop
in
range
(
self
.
loop_restart_times
):
db_name
=
"sync_db_{}"
.
format
(
loop
)
stablename
=
'stable_{}'
.
format
(
loop
)
self
.
create_database
(
dbname
=
db_name
,
replica_num
=
self
.
replica
,
vgroup_nums
=
1
)
self
.
create_stable_insert_datas
(
dbname
=
db_name
,
stablename
=
stablename
,
tb_nums
=
10
,
row_nums
=
10
)
self
.
stop_dnode_id
=
self
.
_get_stop_dnode_id
(
db_name
)
self
.
stop_dnode_id
=
self
.
_get_stop_dnode_id
(
db_name
,
"follower"
)
# check rows of datas
...
...
@@ -386,7 +387,7 @@ class TDTestCase:
start
=
time
.
time
()
tdDnodes
[
self
.
stop_dnode_id
-
1
].
stoptaosd
()
self
.
wait_stop_dnode_OK
()
self
.
wait_stop_dnode_OK
(
newTdSql
)
# append rows of stablename when dnode stop
...
...
@@ -404,7 +405,7 @@ class TDTestCase:
# begin start dnode
tdDnodes
[
self
.
stop_dnode_id
-
1
].
starttaosd
()
self
.
wait_start_dnode_OK
()
self
.
wait_start_dnode_OK
(
newTdSql
)
end
=
time
.
time
()
time_cost
=
int
(
end
-
start
)
if
time_cost
>
self
.
max_restart_time
:
...
...
@@ -421,7 +422,7 @@ class TDTestCase:
def
_restart_dnode_of_db_unsync
(
dbname
):
start
=
time
.
time
()
tdDnodes
=
cluster
.
dnodes
self
.
stop_dnode_id
=
self
.
_get_stop_dnode_id
(
dbname
)
self
.
stop_dnode_id
=
self
.
_get_stop_dnode_id
(
dbname
,
"follower"
)
# begin restart dnode
tdDnodes
[
self
.
stop_dnode_id
-
1
].
stoptaosd
()
self
.
wait_stop_dnode_OK
()
...
...
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_unsync.py
浏览文件 @
f1e28fb8
...
...
@@ -236,10 +236,10 @@ class TDTestCase:
return
self
.
stop_dnode_id
def
wait_stop_dnode_OK
(
self
):
def
wait_stop_dnode_OK
(
self
,
newTdSql
):
def
_get_status
():
newTdSql
=
tdCom
.
newTdSql
()
#
newTdSql=tdCom.newTdSql()
status
=
""
newTdSql
.
query
(
"show dnodes"
)
...
...
@@ -259,10 +259,10 @@ class TDTestCase:
# tdLog.notice("==== stop dnode has not been stopped , endpoint is {}".format(self.stop_dnode))
tdLog
.
notice
(
"==== stop_dnode has stopped , id is {}"
.
format
(
self
.
stop_dnode_id
))
def
wait_start_dnode_OK
(
self
):
def
wait_start_dnode_OK
(
self
,
newTdSql
):
def
_get_status
():
newTdSql
=
tdCom
.
newTdSql
()
#
newTdSql=tdCom.newTdSql()
status
=
""
newTdSql
.
query
(
"show dnodes"
)
dnode_infos
=
newTdSql
.
queryResult
...
...
@@ -370,6 +370,7 @@ class TDTestCase:
def
sync_run_case
(
self
):
# stop follower and insert datas , update tables and create new stables
tdDnodes
=
cluster
.
dnodes
newTdSql
=
tdCom
.
newTdSql
()
for
loop
in
range
(
self
.
loop_restart_times
):
db_name
=
"sync_db_{}"
.
format
(
loop
)
stablename
=
'stable_{}'
.
format
(
loop
)
...
...
@@ -385,7 +386,7 @@ class TDTestCase:
start
=
time
.
time
()
tdDnodes
[
self
.
stop_dnode_id
-
1
].
stoptaosd
()
self
.
wait_stop_dnode_OK
()
self
.
wait_stop_dnode_OK
(
newTdSql
)
# append rows of stablename when dnode stop
...
...
@@ -403,7 +404,7 @@ class TDTestCase:
# begin start dnode
tdDnodes
[
self
.
stop_dnode_id
-
1
].
starttaosd
()
self
.
wait_start_dnode_OK
()
self
.
wait_start_dnode_OK
(
newTdSql
)
end
=
time
.
time
()
time_cost
=
int
(
end
-
start
)
if
time_cost
>
self
.
max_restart_time
:
...
...
@@ -418,14 +419,15 @@ class TDTestCase:
def
unsync_run_case
(
self
):
def
_restart_dnode_of_db_unsync
(
dbname
):
newTdSql
=
tdCom
.
newTdSql
()
start
=
time
.
time
()
tdDnodes
=
cluster
.
dnodes
self
.
stop_dnode_id
=
self
.
_get_stop_dnode_id
(
dbname
)
# begin restart dnode
tdDnodes
[
self
.
stop_dnode_id
-
1
].
stoptaosd
()
self
.
wait_stop_dnode_OK
()
self
.
wait_stop_dnode_OK
(
newTdSql
)
tdDnodes
[
self
.
stop_dnode_id
-
1
].
starttaosd
()
self
.
wait_start_dnode_OK
()
self
.
wait_start_dnode_OK
(
newTdSql
)
end
=
time
.
time
()
time_cost
=
int
(
end
-
start
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录