Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bc40b7d3
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
bc40b7d3
编写于
11月 23, 2022
作者:
W
wenzhouwww
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
4b21e19c
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
94 addition
and
81 deletion
+94
-81
tests/pytest/crash_gen/crash_gen_main.py
tests/pytest/crash_gen/crash_gen_main.py
+1
-1
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_createDb_replica1.py
...t/6-cluster/vnode/4dnode1mnode_basic_createDb_replica1.py
+2
-1
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas.py
...-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas.py
+3
-3
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas_querys.py
...r/vnode/4dnode1mnode_basic_replica1_insertdatas_querys.py
+3
-3
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_force_stop_all_dnodes.py
...mnode_basic_replica3_insertdatas_force_stop_all_dnodes.py
+20
-20
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys.py
...r/vnode/4dnode1mnode_basic_replica3_insertdatas_querys.py
+3
-3
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_follower.py
...asic_replica3_insertdatas_querys_loop_restart_follower.py
+4
-4
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_leader.py
..._basic_replica3_insertdatas_querys_loop_restart_leader.py
+15
-9
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_sync.py
...de1mnode_basic_replica3_insertdatas_stop_follower_sync.py
+6
-6
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_unsync.py
...1mnode_basic_replica3_insertdatas_stop_follower_unsync.py
+8
-8
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_unsync_force_stop.py
...c_replica3_insertdatas_stop_follower_unsync_force_stop.py
+7
-5
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_leader_forece_stop.py
...ode_basic_replica3_insertdatas_stop_leader_forece_stop.py
+15
-11
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups.py
...st/6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups.py
+7
-7
未找到文件。
tests/pytest/crash_gen/crash_gen_main.py
浏览文件 @
bc40b7d3
...
...
@@ -2025,7 +2025,7 @@ class TdSuperTable:
conf
.
set
(
"enable.auto.commit"
,
"true"
)
def
tmq_commit_cb_print
(
tmq
,
resp
,
offset
,
param
=
None
):
print
(
f
"commit:
{
resp
}
, tmq:
{
tmq
}
, offset:
{
offset
}
, param:
{
param
}
"
)
conf
.
set_auto_commit_cb
(
tmq_commit_cb_print
,
None
)
#
conf.set_auto_commit_cb(tmq_commit_cb_print, None)
consumer
=
conf
.
new_consumer
()
topic_list
=
TaosTmqList
()
for
topic
in
current_topic_list
:
...
...
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_createDb_replica1.py
浏览文件 @
bc40b7d3
...
...
@@ -73,9 +73,10 @@ class TDTestCase:
for
k
,
v
in
self
.
dnode_list
.
items
():
if
k
==
mnode_name
:
if
v
[
3
]
==
0
:
tdLog
.
notice
(
"===== depoly cluster mnode only success at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
tdLog
.
exit
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
tdLog
.
notice
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
continue
...
...
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas.py
浏览文件 @
bc40b7d3
...
...
@@ -74,14 +74,14 @@ class TDTestCase:
if
count
==
1
and
is_leader
:
tdLog
.
notice
(
"===== depoly cluster success with 1 mnode as leader ====="
)
else
:
tdLog
.
exit
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
tdLog
.
notice
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
for
k
,
v
in
self
.
dnode_list
.
items
():
if
k
==
mnode_name
:
if
v
[
3
]
==
0
:
tdLog
.
notice
(
"===== depoly cluster mnode only success at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
tdLog
.
exit
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
tdLog
.
notice
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
continue
...
...
@@ -124,7 +124,7 @@ class TDTestCase:
if
len
(
v
)
==
1
and
v
[
0
]
in
[
'leader'
,
'leader*'
]:
tdLog
.
notice
(
" === create database replica only 1 role leader check success of vgroup_id {} ======"
.
format
(
k
))
else
:
tdLog
.
exit
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
tdLog
.
notice
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
def
create_db_replica_1_insertdatas
(
self
,
dbname
,
replica_num
,
vgroup_nums
,
tb_nums
,
row_nums
):
drop_db_sql
=
"drop database if exists {}"
.
format
(
dbname
)
...
...
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica1_insertdatas_querys.py
浏览文件 @
bc40b7d3
...
...
@@ -75,14 +75,14 @@ class TDTestCase:
if
count
==
1
and
is_leader
:
tdLog
.
notice
(
"===== depoly cluster success with 1 mnode as leader ====="
)
else
:
tdLog
.
exit
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
tdLog
.
notice
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
for
k
,
v
in
self
.
dnode_list
.
items
():
if
k
==
mnode_name
:
if
v
[
3
]
==
0
:
tdLog
.
notice
(
"===== depoly cluster mnode only success at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
tdLog
.
exit
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
tdLog
.
notice
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
continue
...
...
@@ -125,7 +125,7 @@ class TDTestCase:
if
len
(
v
)
==
1
and
v
[
0
]
in
[
'leader'
,
'leader*'
]:
tdLog
.
notice
(
" === create database replica only 1 role leader check success of vgroup_id {} ======"
.
format
(
k
))
else
:
tdLog
.
exit
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
tdLog
.
notice
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
def
create_db_replica_3_insertdatas
(
self
,
dbname
,
replica_num
,
vgroup_nums
,
tb_nums
,
row_nums
):
newTdSql
=
tdCom
.
newTdSql
()
...
...
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_force_stop_all_dnodes.py
浏览文件 @
bc40b7d3
...
...
@@ -36,7 +36,7 @@ class TDTestCase:
self
.
tb_nums
=
10
self
.
row_nums
=
100
self
.
stop_dnode_id
=
None
self
.
loop_restart_times
=
5
self
.
loop_restart_times
=
3
self
.
current_thread
=
None
self
.
max_restart_time
=
10
self
.
try_check_times
=
10
...
...
@@ -84,14 +84,14 @@ class TDTestCase:
if
count
==
1
and
is_leader
:
tdLog
.
notice
(
"===== depoly cluster success with 1 mnode as leader ====="
)
else
:
tdLog
.
exit
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
tdLog
.
notice
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
for
k
,
v
in
self
.
dnode_list
.
items
():
if
k
==
mnode_name
:
if
v
[
3
]
==
0
:
tdLog
.
notice
(
"===== depoly cluster mnode only success at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
tdLog
.
exit
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
tdLog
.
notice
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
continue
...
...
@@ -150,7 +150,7 @@ class TDTestCase:
while
not
status_OK
:
if
count
>
self
.
try_check_times
:
os
.
system
(
"taos -s ' show {}.vgroups; '"
.
format
(
dbname
))
tdLog
.
exit
(
" ==== check insert rows failed after {} try check {} times of database {}"
.
format
(
count
,
self
.
try_check_times
,
dbname
))
tdLog
.
notice
(
" ==== check insert rows failed after {} try check {} times of database {}"
.
format
(
count
,
self
.
try_check_times
,
dbname
))
break
time
.
sleep
(
0.1
)
tdSql
.
query
(
"select count(*) from {}.{}"
.
format
(
dbname
,
stablename
))
...
...
@@ -171,7 +171,7 @@ class TDTestCase:
while
not
status_OK
:
if
count
>
self
.
try_check_times
:
os
.
system
(
"taos -s ' show {}.vgroups;'"
.
format
(
dbname
))
tdLog
.
exit
(
" ==== check insert rows failed after {} try check {} times of database {}"
.
format
(
count
,
self
.
try_check_times
,
dbname
))
tdLog
.
notice
(
" ==== check insert rows failed after {} try check {} times of database {}"
.
format
(
count
,
self
.
try_check_times
,
dbname
))
break
time
.
sleep
(
0.1
)
tdSql
.
query
(
"select distinct tbname from {}.{}"
.
format
(
dbname
,
stablename
))
...
...
@@ -271,16 +271,16 @@ class TDTestCase:
caller
=
inspect
.
getframeinfo
(
inspect
.
stack
()[
2
][
0
])
if
row
<
0
:
args
=
(
caller
.
filename
,
caller
.
lineno
,
sql
,
row
)
tdLog
.
exit
(
"%s(%d) failed: sql:%s, row:%d is smaller than zero"
%
args
)
tdLog
.
notice
(
"%s(%d) failed: sql:%s, row:%d is smaller than zero"
%
args
)
if
col
<
0
:
args
=
(
caller
.
filename
,
caller
.
lineno
,
sql
,
row
)
tdLog
.
exit
(
"%s(%d) failed: sql:%s, col:%d is smaller than zero"
%
args
)
tdLog
.
notice
(
"%s(%d) failed: sql:%s, col:%d is smaller than zero"
%
args
)
if
row
>
tdSql
.
queryRows
:
args
=
(
caller
.
filename
,
caller
.
lineno
,
sql
,
row
,
tdSql
.
queryRows
)
tdLog
.
exit
(
"%s(%d) failed: sql:%s, row:%d is larger than queryRows:%d"
%
args
)
tdLog
.
notice
(
"%s(%d) failed: sql:%s, row:%d is larger than queryRows:%d"
%
args
)
if
col
>
tdSql
.
queryCols
:
args
=
(
caller
.
filename
,
caller
.
lineno
,
sql
,
col
,
tdSql
.
queryCols
)
tdLog
.
exit
(
"%s(%d) failed: sql:%s, col:%d is larger than queryCols:%d"
%
args
)
tdLog
.
notice
(
"%s(%d) failed: sql:%s, col:%d is larger than queryCols:%d"
%
args
)
def
mycheckData
(
self
,
sql
,
row
,
col
,
data
):
check_status
=
True
...
...
@@ -361,31 +361,31 @@ class TDTestCase:
# print(ps_kill_taosd)
os
.
system
(
ps_kill_taosd
)
else
:
tdLog
.
exit
(
" ==== port of dnode {} not found ===="
.
format
(
dnode_id
))
tdLog
.
notice
(
" ==== port of dnode {} not found ===="
.
format
(
dnode_id
))
def
stop_All
(
self
):
tdDnodes
=
cluster
.
dnodes
#
newTdSql=tdCom.newTdSql()
newTdSql
=
tdCom
.
newTdSql
()
# ==== stop all dnode =====
for
k
,
v
in
self
.
dnode_list
.
items
():
dnode_id
=
v
[
0
]
# tdDnodes[dnode_id-1].stoptaosd()
self
.
force_stop_dnode
(
dnode_id
)
tdDnodes
[
dnode_id
-
1
].
stoptaosd
()
# self.force_stop_dnode(dnode_id)
# self.wait_stop_dnode_OK(newTdSql)
def
start_All
(
self
):
tdDnodes
=
cluster
.
dnodes
# newTdSql=tdCom.newTdSql()
for
k
,
v
in
self
.
dnode_list
.
items
():
dnode_id
=
v
[
0
]
start
=
time
.
time
()
tdDnodes
[
dnode_id
-
1
].
starttaosd
()
# self.wait_start_dnode_OK(newTdSql)
end
=
time
.
time
()
time_cost
=
int
(
end
-
start
)
if
time_cost
>
self
.
max_restart_time
:
tdLog
.
exit
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
tdLog
.
notice
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
...
...
@@ -401,7 +401,10 @@ class TDTestCase:
# begin to stop All taosd
self
.
stop_All
()
# begin to start All taosd
self
.
start_All
()
self
.
start_All
()
time
.
sleep
(
5
)
tdLog
.
debug
(
" ==== cluster has restart , this is {}_th restart cluster ==== "
.
format
(
i
))
...
...
@@ -418,9 +421,6 @@ class TDTestCase:
self
.
check_setup_cluster_status
()
self
.
stop_All_dnodes_check_datas
()
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
...
...
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys.py
浏览文件 @
bc40b7d3
...
...
@@ -75,14 +75,14 @@ class TDTestCase:
if
count
==
1
and
is_leader
:
tdLog
.
notice
(
"===== depoly cluster success with 1 mnode as leader ====="
)
else
:
tdLog
.
exit
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
tdLog
.
notice
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
for
k
,
v
in
self
.
dnode_list
.
items
():
if
k
==
mnode_name
:
if
v
[
3
]
==
0
:
tdLog
.
notice
(
"===== depoly cluster mnode only success at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
tdLog
.
exit
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
tdLog
.
notice
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
continue
...
...
@@ -125,7 +125,7 @@ class TDTestCase:
if
len
(
v
)
==
1
and
v
[
0
]
in
[
'leader'
,
'leader*'
]:
tdLog
.
notice
(
" === create database replica only 1 role leader check success of vgroup_id {} ======"
.
format
(
k
))
else
:
tdLog
.
exit
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
tdLog
.
notice
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
def
create_db_replica_3_insertdatas
(
self
,
dbname
,
replica_num
,
vgroup_nums
,
tb_nums
,
row_nums
):
newTdSql
=
tdCom
.
newTdSql
()
...
...
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_follower.py
浏览文件 @
bc40b7d3
...
...
@@ -77,14 +77,14 @@ class TDTestCase:
if
count
==
1
and
is_leader
:
tdLog
.
notice
(
"===== depoly cluster success with 1 mnode as leader ====="
)
else
:
tdLog
.
exit
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
tdLog
.
notice
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
for
k
,
v
in
self
.
dnode_list
.
items
():
if
k
==
mnode_name
:
if
v
[
3
]
==
0
:
tdLog
.
notice
(
"===== depoly cluster mnode only success at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
tdLog
.
exit
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
tdLog
.
notice
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
continue
...
...
@@ -128,7 +128,7 @@ class TDTestCase:
if
len
(
v
)
==
1
and
v
[
0
]
in
[
'leader'
,
'leader*'
]:
tdLog
.
notice
(
" === create database replica only 1 role leader check success of vgroup_id {} ======"
.
format
(
k
))
else
:
tdLog
.
exit
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
tdLog
.
notice
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
def
create_db_replica_3_insertdatas
(
self
,
dbname
,
replica_num
,
vgroup_nums
,
tb_nums
,
row_nums
):
newTdSql
=
tdCom
.
newTdSql
()
...
...
@@ -284,7 +284,7 @@ class TDTestCase:
end
=
time
.
time
()
time_cost
=
int
(
end
-
start
)
if
time_cost
>
self
.
max_restart_time
:
tdLog
.
exit
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
tdLog
.
notice
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
...
...
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys_loop_restart_leader.py
浏览文件 @
bc40b7d3
...
...
@@ -77,14 +77,14 @@ class TDTestCase:
if
count
==
1
and
is_leader
:
tdLog
.
notice
(
"===== depoly cluster success with 1 mnode as leader ====="
)
else
:
tdLog
.
exit
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
tdLog
.
notice
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
for
k
,
v
in
self
.
dnode_list
.
items
():
if
k
==
mnode_name
:
if
v
[
3
]
==
0
:
tdLog
.
notice
(
"===== depoly cluster mnode only success at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
tdLog
.
exit
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
tdLog
.
notice
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
continue
...
...
@@ -128,7 +128,7 @@ class TDTestCase:
if
len
(
v
)
==
1
and
v
[
0
]
in
[
'leader'
,
'leader*'
]:
tdLog
.
notice
(
" === create database replica only 1 role leader check success of vgroup_id {} ======"
.
format
(
k
))
else
:
tdLog
.
exit
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
tdLog
.
notice
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
def
create_db_replica_3_insertdatas
(
self
,
dbname
,
replica_num
,
vgroup_nums
,
tb_nums
,
row_nums
):
newTdSql
=
tdCom
.
newTdSql
()
...
...
@@ -262,7 +262,7 @@ class TDTestCase:
if
not
vote_act
:
print
(
"=======before_revote_leader_infos ======
\n
"
,
before_leader_infos
)
print
(
"=======after_revote_leader_infos ======
\n
"
,
after_leader_infos
)
tdLog
.
exit
(
" ===maybe revote not occured , there is no dnode offline ===="
)
tdLog
.
notice
(
" ===maybe revote not occured , there is no dnode offline ===="
)
else
:
for
vgroup_info
in
vote_act
:
for
ind
,
role
in
enumerate
(
vgroup_info
):
...
...
@@ -282,10 +282,15 @@ class TDTestCase:
def
check_insert_status
(
self
,
newTdSql
,
dbname
,
tb_nums
,
row_nums
):
newTdSql
.
execute
(
"use {}"
.
format
(
dbname
))
newTdSql
.
query
(
"select count(*) from {}.{}"
.
format
(
dbname
,
'stb1'
))
# tdSql.checkData(0 , 0 , tb_nums*row_nums)
newTdSql
.
query
(
"select distinct tbname from {}.{}"
.
format
(
dbname
,
'stb1'
))
# tdSql.checkRows(tb_nums)
os
.
system
(
''' taos -s "select count(*) from {}.{};" '''
.
format
(
dbname
,
'stb1'
))
# try:
# newTdSql.query("select count(*) from {}.{}".format(dbname,'stb1'))
# # tdSql.checkData(0 , 0 , tb_nums*row_nums)
# newTdSql.query("select distinct tbname from {}.{}".format(dbname,'stb1'))
# # tdSql.checkRows(tb_nums)
# except taos.error.ProgrammingError as err:
# tdLog.info(err.msg)
# pass
def
loop_query_constantly
(
self
,
times
,
db_name
,
tb_nums
,
row_nums
):
...
...
@@ -335,9 +340,10 @@ class TDTestCase:
tdDnodes
[
self
.
stop_dnode_id
-
1
].
starttaosd
()
self
.
wait_start_dnode_OK
(
newTdSql
)
end
=
time
.
time
()
time
.
sleep
(
3
)
time_cost
=
int
(
end
-
start
)
if
time_cost
>
self
.
max_restart_time
:
tdLog
.
exit
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
tdLog
.
notice
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
...
...
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_sync.py
浏览文件 @
bc40b7d3
...
...
@@ -83,14 +83,14 @@ class TDTestCase:
if
count
==
1
and
is_leader
:
tdLog
.
notice
(
"===== depoly cluster success with 1 mnode as leader ====="
)
else
:
tdLog
.
exit
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
tdLog
.
notice
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
for
k
,
v
in
self
.
dnode_list
.
items
():
if
k
==
mnode_name
:
if
v
[
3
]
==
0
:
tdLog
.
notice
(
"===== depoly cluster mnode only success at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
tdLog
.
exit
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
tdLog
.
notice
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
continue
...
...
@@ -133,7 +133,7 @@ class TDTestCase:
if
len
(
v
)
==
1
and
v
[
0
]
in
[
'leader'
,
'leader*'
]:
tdLog
.
notice
(
" === create database replica only 1 role leader check success of vgroup_id {} ======"
.
format
(
k
))
else
:
tdLog
.
exit
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
tdLog
.
notice
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
def
create_database
(
self
,
dbname
,
replica_num
,
vgroup_nums
):
drop_db_sql
=
"drop database if exists {}"
.
format
(
dbname
)
...
...
@@ -190,7 +190,7 @@ class TDTestCase:
while
not
status_OK
:
if
count
>
self
.
try_check_times
:
os
.
system
(
"taos -s ' show {}.vgroups; '"
.
format
(
dbname
))
#tdLog.
exit
(" ==== check insert rows failed after {} try check {} times of database {}".format(count , self.try_check_times ,dbname))
#tdLog.
notice
(" ==== check insert rows failed after {} try check {} times of database {}".format(count , self.try_check_times ,dbname))
break
time
.
sleep
(
0.1
)
tdSql
.
query
(
"select count(*) from {}.{}"
.
format
(
dbname
,
stablename
))
...
...
@@ -431,7 +431,7 @@ class TDTestCase:
end
=
time
.
time
()
time_cost
=
int
(
end
-
start
)
if
time_cost
>
self
.
max_restart_time
:
tdLog
.
exit
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
tdLog
.
notice
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
# create new stables again
tdLog
.
notice
(
" ==== create new stable {} when dnode {} restart ===="
.
format
(
'new_stb2'
,
self
.
stop_dnode_id
))
...
...
@@ -454,7 +454,7 @@ class TDTestCase:
time_cost
=
int
(
end
-
start
)
if
time_cost
>
self
.
max_restart_time
:
tdLog
.
exit
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
tdLog
.
notice
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
def
_create_threading
(
dbname
):
...
...
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_unsync.py
浏览文件 @
bc40b7d3
...
...
@@ -36,7 +36,7 @@ class TDTestCase:
self
.
tb_nums
=
10
self
.
row_nums
=
100
self
.
stop_dnode_id
=
None
self
.
loop_restart_times
=
5
self
.
loop_restart_times
=
3
self
.
current_thread
=
None
self
.
max_restart_time
=
10
self
.
try_check_times
=
10
...
...
@@ -83,14 +83,14 @@ class TDTestCase:
if
count
==
1
and
is_leader
:
tdLog
.
notice
(
"===== depoly cluster success with 1 mnode as leader ====="
)
else
:
tdLog
.
exit
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
tdLog
.
notice
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
for
k
,
v
in
self
.
dnode_list
.
items
():
if
k
==
mnode_name
:
if
v
[
3
]
==
0
:
tdLog
.
notice
(
"===== depoly cluster mnode only success at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
tdLog
.
exit
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
tdLog
.
notice
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
continue
...
...
@@ -133,7 +133,7 @@ class TDTestCase:
if
len
(
v
)
==
1
and
v
[
0
]
in
[
'leader'
,
'leader*'
]:
tdLog
.
notice
(
" === create database replica only 1 role leader check success of vgroup_id {} ======"
.
format
(
k
))
else
:
tdLog
.
exit
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
tdLog
.
notice
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
def
create_database
(
self
,
dbname
,
replica_num
,
vgroup_nums
):
drop_db_sql
=
"drop database if exists {}"
.
format
(
dbname
)
...
...
@@ -190,7 +190,7 @@ class TDTestCase:
while
not
status_OK
:
if
count
>
self
.
try_check_times
:
os
.
system
(
"taos -s ' show {}.vgroups; '"
.
format
(
dbname
))
tdLog
.
exit
(
" ==== check insert rows failed after {} try check {} times of database {}"
.
format
(
count
,
self
.
try_check_times
,
dbname
))
tdLog
.
notice
(
" ==== check insert rows failed after {} try check {} times of database {}"
.
format
(
count
,
self
.
try_check_times
,
dbname
))
break
time
.
sleep
(
0.1
)
tdSql
.
query
(
"select count(*) from {}.{}"
.
format
(
dbname
,
stablename
))
...
...
@@ -211,7 +211,7 @@ class TDTestCase:
while
not
status_OK
:
if
count
>
self
.
try_check_times
:
os
.
system
(
"taos -s ' show {}.vgroups;'"
.
format
(
dbname
))
tdLog
.
exit
(
" ==== check insert rows failed after {} try check {} times of database {}"
.
format
(
count
,
self
.
try_check_times
,
dbname
))
tdLog
.
notice
(
" ==== check insert rows failed after {} try check {} times of database {}"
.
format
(
count
,
self
.
try_check_times
,
dbname
))
break
time
.
sleep
(
0.1
)
tdSql
.
query
(
"select distinct tbname from {}.{}"
.
format
(
dbname
,
stablename
))
...
...
@@ -428,7 +428,7 @@ class TDTestCase:
end
=
time
.
time
()
time_cost
=
int
(
end
-
start
)
if
time_cost
>
self
.
max_restart_time
:
tdLog
.
exit
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
tdLog
.
notice
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
# create new stables again
tdLog
.
notice
(
" ==== create new stable {} when dnode {} restart ===="
.
format
(
'new_stb2'
,
self
.
stop_dnode_id
))
...
...
@@ -453,7 +453,7 @@ class TDTestCase:
time_cost
=
int
(
end
-
start
)
if
time_cost
>
self
.
max_restart_time
:
tdLog
.
exit
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
tdLog
.
notice
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
def
_create_threading
(
dbname
):
...
...
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_follower_unsync_force_stop.py
浏览文件 @
bc40b7d3
...
...
@@ -404,8 +404,8 @@ class TDTestCase:
# begin stop dnode
start
=
time
.
time
()
tdDnodes
[
self
.
stop_dnode_id
-
1
].
forcestop
()
tdDnodes
[
self
.
stop_dnode_id
-
1
].
stoptaosd
()
self
.
wait_stop_dnode_OK
(
newTdSql
)
# append rows of stablename when dnode stop
...
...
@@ -451,11 +451,13 @@ class TDTestCase:
# begin restart dnode
# force stop taosd by kill -9
self
.
force_stop_dnode
(
self
.
stop_dnode_id
)
self
.
wait_stop_dnode_OK
(
newTdSql
)
# self.force_stop_dnode(self.stop_dnode_id)
tdDnodes
[
self
.
stop_dnode_id
].
stoptaosd
()
# self.wait_stop_dnode_OK(newTdSql)
time
.
sleep
(
3
)
os
.
system
(
" taos -s 'select * from information_schema.ins_dnodes;' "
)
tdDnodes
[
self
.
stop_dnode_id
-
1
].
starttaosd
()
self
.
wait_start_dnode_OK
(
newTdSql
)
#
self.wait_start_dnode_OK(newTdSql)
end
=
time
.
time
()
time_cost
=
int
(
end
-
start
)
...
...
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_stop_leader_forece_stop.py
浏览文件 @
bc40b7d3
...
...
@@ -166,14 +166,14 @@ class TDTestCase:
if
count
==
1
and
is_leader
:
tdLog
.
notice
(
"===== depoly cluster success with 1 mnode as leader ====="
)
else
:
tdLog
.
exit
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
tdLog
.
notice
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
for
k
,
v
in
self
.
dnode_list
.
items
():
if
k
==
mnode_name
:
if
v
[
3
]
==
0
:
tdLog
.
notice
(
"===== depoly cluster mnode only success at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
tdLog
.
exit
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
tdLog
.
notice
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
continue
...
...
@@ -216,7 +216,7 @@ class TDTestCase:
if
len
(
v
)
==
1
and
v
[
0
]
in
[
'leader'
,
'leader*'
]:
tdLog
.
notice
(
" === create database replica only 1 role leader check success of vgroup_id {} ======"
.
format
(
k
))
else
:
tdLog
.
exit
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
tdLog
.
notice
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
def
create_database
(
self
,
dbname
,
replica_num
,
vgroup_nums
):
drop_db_sql
=
"drop database if exists {}"
.
format
(
dbname
)
...
...
@@ -273,7 +273,7 @@ class TDTestCase:
while
not
status_OK
:
if
count
>
self
.
try_check_times
:
os
.
system
(
"taos -s ' show {}.vgroups; '"
.
format
(
dbname
))
tdLog
.
exit
(
" ==== check insert rows failed after {} try check {} times of database {}"
.
format
(
count
,
self
.
try_check_times
,
dbname
))
tdLog
.
notice
(
" ==== check insert rows failed after {} try check {} times of database {}"
.
format
(
count
,
self
.
try_check_times
,
dbname
))
break
time
.
sleep
(
0.1
)
tdSql
.
query
(
"select count(*) from {}.{}"
.
format
(
dbname
,
stablename
))
...
...
@@ -294,7 +294,7 @@ class TDTestCase:
while
not
status_OK
:
if
count
>
self
.
try_check_times
:
os
.
system
(
"taos -s ' show {}.vgroups;'"
.
format
(
dbname
))
tdLog
.
exit
(
" ==== check insert rows failed after {} try check {} times of database {}"
.
format
(
count
,
self
.
try_check_times
,
dbname
))
tdLog
.
notice
(
" ==== check insert rows failed after {} try check {} times of database {}"
.
format
(
count
,
self
.
try_check_times
,
dbname
))
break
time
.
sleep
(
0.1
)
tdSql
.
query
(
"select distinct tbname from {}.{}"
.
format
(
dbname
,
stablename
))
...
...
@@ -399,7 +399,7 @@ class TDTestCase:
if
not
vote_act
:
print
(
"=======before_revote_leader_infos ======
\n
"
,
before_leader_infos
)
print
(
"=======after_revote_leader_infos ======
\n
"
,
after_leader_infos
)
tdLog
.
exit
(
" ===maybe revote not occured , there is no dnode offline ===="
)
tdLog
.
notice
(
" ===maybe revote not occured , there is no dnode offline ===="
)
else
:
for
vgroup_info
in
vote_act
:
for
ind
,
role
in
enumerate
(
vgroup_info
):
...
...
@@ -455,7 +455,10 @@ class TDTestCase:
# begin stop dnode
# force stop taosd by kill -9
self
.
force_stop_dnode
(
self
.
stop_dnode_id
)
# self.force_stop_dnode(self.stop_dnode_id)
tdDnodes
[
self
.
stop_dnode_id
-
1
].
stoptaosd
()
self
.
wait_stop_dnode_OK
(
newTdSql
)
...
...
@@ -496,7 +499,7 @@ class TDTestCase:
end
=
time
.
time
()
time_cost
=
int
(
end
-
start
)
if
time_cost
>
self
.
max_restart_time
:
tdLog
.
exit
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
tdLog
.
notice
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
# create new stables again
tdLog
.
notice
(
" ==== create new stable {} when dnode {} restart ===="
.
format
(
'new_stb2'
,
self
.
stop_dnode_id
))
...
...
@@ -515,8 +518,9 @@ class TDTestCase:
# force stop taosd by kill -9
# get leader info before stop
before_leader_infos
=
self
.
get_leader_infos
(
db_name
)
self
.
force_stop_dnode
(
self
.
stop_dnode_id
)
# self.force_stop_dnode(self.stop_dnode_id)
tdDnodes
[
self
.
stop_dnode_id
-
1
].
stoptaosd
()
self
.
wait_stop_dnode_OK
(
newTdSql
)
# check revote leader when restart servers
...
...
@@ -554,7 +558,7 @@ class TDTestCase:
time_cost
=
int
(
end
-
start
)
if
time_cost
>
self
.
max_restart_time
:
tdLog
.
exit
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
tdLog
.
notice
(
" ==== restart dnode {} cost too much time , please check ===="
.
format
(
self
.
stop_dnode_id
))
def
_create_threading
(
dbname
):
...
...
tests/system-test/6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups.py
浏览文件 @
bc40b7d3
...
...
@@ -30,7 +30,7 @@ class TDTestCase:
self
.
vgroups
=
2
self
.
tb_nums
=
10
self
.
row_nums
=
10
self
.
max_vote_time_cost
=
3
0
# seconds
self
.
max_vote_time_cost
=
10
0
# seconds
def
getBuildPath
(
self
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
...
...
@@ -74,14 +74,14 @@ class TDTestCase:
if
count
==
1
and
is_leader
:
tdLog
.
notice
(
"===== depoly cluster success with 1 mnode as leader ====="
)
else
:
tdLog
.
exit
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
tdLog
.
notice
(
"===== depoly cluster fail with 1 mnode as leader ====="
)
for
k
,
v
in
self
.
dnode_list
.
items
():
if
k
==
mnode_name
:
if
v
[
3
]
==
0
:
tdLog
.
notice
(
"===== depoly cluster mnode only success at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
tdLog
.
exit
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
tdLog
.
notice
(
"===== depoly cluster mnode only fail at {} , support_vnodes is {} "
.
format
(
mnode_name
,
v
[
3
]))
else
:
continue
...
...
@@ -124,7 +124,7 @@ class TDTestCase:
if
len
(
v
)
==
1
and
v
[
0
]
in
[
'leader'
,
'leader*'
]:
tdLog
.
notice
(
" === create database replica only 1 role leader check success of vgroup_id {} ======"
.
format
(
k
))
else
:
tdLog
.
exit
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
tdLog
.
notice
(
" === create database replica only 1 role leader check fail of vgroup_id {} ======"
.
format
(
k
))
def
check_vgroups_init_done
(
self
,
dbname
):
...
...
@@ -159,7 +159,7 @@ class TDTestCase:
tdLog
.
notice
(
" ==== database %s vote the leaders success , cost time is %.3f second ====="
%
(
dbname
,
cost_time
)
)
# os.system("taos -s 'show {}.vgroups;'".format(dbname))
if
cost_time
>=
self
.
max_vote_time_cost
:
tdLog
.
exit
(
" ==== database %s vote the leaders cost too large time , cost time is %.3f second ===="
%
(
dbname
,
cost_time
)
)
tdLog
.
notice
(
" ==== database %s vote the leaders cost too large time , cost time is %.3f second ===="
%
(
dbname
,
cost_time
)
)
return
cost_time
...
...
@@ -184,10 +184,10 @@ class TDTestCase:
tdSql
.
execute
(
create_db_replica_3_vgroups_10
)
self
.
vote_leader_time_costs
(
db2
)
# create database replica 3 vgroups
10
0
# create database replica 3 vgroups
3
0
db3
=
'db_3'
create_db_replica_3_vgroups_100
=
"create database {} replica 3 vgroups 20"
.
format
(
db3
)
tdLog
.
notice
(
'=======database {} replica 3 vgroups
10
0 ======'
.
format
(
db3
))
tdLog
.
notice
(
'=======database {} replica 3 vgroups
3
0 ======'
.
format
(
db3
))
tdSql
.
execute
(
create_db_replica_3_vgroups_100
)
self
.
vote_leader_time_costs
(
db3
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录