Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f40c9d5d
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看板
提交
f40c9d5d
编写于
6月 07, 2021
作者:
T
tickduan
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into cq
上级
47f85222
6da72d82
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
85 addition
and
19 deletion
+85
-19
src/common/src/tvariant.c
src/common/src/tvariant.c
+1
-1
src/util/inc/tutil.h
src/util/inc/tutil.h
+1
-0
src/util/src/tutil.c
src/util/src/tutil.c
+30
-0
tests/mas/Jenkinsfile
tests/mas/Jenkinsfile
+1
-1
tests/pytest/cluster/clusterSetup.py
tests/pytest/cluster/clusterSetup.py
+52
-17
未找到文件。
src/common/src/tvariant.c
浏览文件 @
f40c9d5d
...
@@ -74,7 +74,7 @@ void tVariantCreate(tVariant *pVar, SStrToken *token) {
...
@@ -74,7 +74,7 @@ void tVariantCreate(tVariant *pVar, SStrToken *token) {
case
TSDB_DATA_TYPE_BINARY
:
{
case
TSDB_DATA_TYPE_BINARY
:
{
pVar
->
pz
=
strndup
(
token
->
z
,
token
->
n
);
pVar
->
pz
=
strndup
(
token
->
z
,
token
->
n
);
pVar
->
nLen
=
str
dequote
(
pVar
->
pz
);
pVar
->
nLen
=
str
Rmquote
(
pVar
->
pz
,
token
->
n
);
break
;
break
;
}
}
...
...
src/util/inc/tutil.h
浏览文件 @
f40c9d5d
...
@@ -26,6 +26,7 @@ extern "C" {
...
@@ -26,6 +26,7 @@ extern "C" {
#include "taosdef.h"
#include "taosdef.h"
int32_t
strdequote
(
char
*
src
);
int32_t
strdequote
(
char
*
src
);
int32_t
strRmquote
(
char
*
z
,
int32_t
len
);
size_t
strtrim
(
char
*
src
);
size_t
strtrim
(
char
*
src
);
char
*
strnchr
(
char
*
haystack
,
char
needle
,
int32_t
len
,
bool
skipquote
);
char
*
strnchr
(
char
*
haystack
,
char
needle
,
int32_t
len
,
bool
skipquote
);
char
**
strsplit
(
char
*
src
,
const
char
*
delim
,
int32_t
*
num
);
char
**
strsplit
(
char
*
src
,
const
char
*
delim
,
int32_t
*
num
);
...
...
src/util/src/tutil.c
浏览文件 @
f40c9d5d
...
@@ -52,6 +52,36 @@ int32_t strdequote(char *z) {
...
@@ -52,6 +52,36 @@ int32_t strdequote(char *z) {
return
j
+
1
;
// only one quote, do nothing
return
j
+
1
;
// only one quote, do nothing
}
}
int32_t
strRmquote
(
char
*
z
,
int32_t
len
){
// delete escape character: \\, \', \"
char
delim
=
z
[
0
];
if
(
delim
!=
'\''
&&
delim
!=
'\"'
)
{
return
len
;
}
int32_t
cnt
=
0
;
int32_t
j
=
0
;
for
(
uint32_t
k
=
1
;
k
<
len
-
1
;
++
k
)
{
if
(
z
[
k
]
==
'\\'
||
(
z
[
k
]
==
delim
&&
z
[
k
+
1
]
==
delim
))
{
z
[
j
]
=
z
[
k
+
1
];
cnt
++
;
j
++
;
k
++
;
continue
;
}
z
[
j
]
=
z
[
k
];
j
++
;
}
z
[
j
]
=
0
;
return
len
-
2
-
cnt
;
}
size_t
strtrim
(
char
*
z
)
{
size_t
strtrim
(
char
*
z
)
{
int32_t
i
=
0
;
int32_t
i
=
0
;
int32_t
j
=
0
;
int32_t
j
=
0
;
...
...
tests/mas/Jenkinsfile
浏览文件 @
f40c9d5d
...
@@ -21,7 +21,7 @@ def pre_test(){
...
@@ -21,7 +21,7 @@ def pre_test(){
cmake .. > /dev/null
cmake .. > /dev/null
make > /dev/null
make > /dev/null
make install > /dev/null
make install > /dev/null
pip3 install ${WKC}/src/connector/python/
linux/python3/
pip3 install ${WKC}/src/connector/python/
|| echo 0
'''
'''
return
1
return
1
}
}
...
...
tests/pytest/cluster/clusterSetup.py
浏览文件 @
f40c9d5d
...
@@ -23,7 +23,8 @@ class Node:
...
@@ -23,7 +23,8 @@ class Node:
self
.
hostIP
=
hostIP
self
.
hostIP
=
hostIP
self
.
hostName
=
hostName
self
.
hostName
=
hostName
self
.
homeDir
=
homeDir
self
.
homeDir
=
homeDir
self
.
conn
=
Connection
(
"{}@{}"
.
format
(
username
,
hostName
),
connect_kwargs
=
{
"password"
:
"{}"
.
format
(
password
)})
self
.
corePath
=
'/coredump'
self
.
conn
=
Connection
(
"{}@{}"
.
format
(
username
,
hostName
),
connect_kwargs
=
{
"password"
:
"{}"
.
format
(
password
)})
def
buildTaosd
(
self
):
def
buildTaosd
(
self
):
try
:
try
:
...
@@ -126,21 +127,37 @@ class Node:
...
@@ -126,21 +127,37 @@ class Node:
except
Exception
as
e
:
except
Exception
as
e
:
print
(
"remove taosd error for node %d "
%
self
.
index
)
print
(
"remove taosd error for node %d "
%
self
.
index
)
logging
.
exception
(
e
)
logging
.
exception
(
e
)
def
detectCoredumpFile
(
self
):
try
:
result
=
self
.
conn
.
run
(
"find /coredump -name 'core_*' "
,
hide
=
True
)
output
=
result
.
stdout
print
(
"output: %s"
%
output
)
return
output
except
Exception
as
e
:
print
(
"find coredump file error on node %d "
%
self
.
index
)
logging
.
exception
(
e
)
class
Nodes
:
class
Nodes
:
def
__init__
(
self
):
def
__init__
(
self
):
self
.
tdnodes
=
[]
self
.
tdnodes
=
[]
self
.
tdnodes
.
append
(
Node
(
0
,
'root'
,
'
52.143.103.7'
,
'node1'
,
'a
'
,
'/root/'
))
self
.
tdnodes
.
append
(
Node
(
0
,
'root'
,
'
192.168.17.194'
,
'taosdata'
,
'r
'
,
'/root/'
))
self
.
tdnodes
.
append
(
Node
(
1
,
'root'
,
'52.250.48.222'
,
'node2'
,
'a'
,
'/root/'
))
#
self.tdnodes.append(Node(1, 'root', '52.250.48.222', 'node2', 'a', '/root/'))
self
.
tdnodes
.
append
(
Node
(
2
,
'root'
,
'51.141.167.23'
,
'node3'
,
'a'
,
'/root/'
))
#
self.tdnodes.append(Node(2, 'root', '51.141.167.23', 'node3', 'a', '/root/'))
self
.
tdnodes
.
append
(
Node
(
3
,
'root'
,
'52.247.207.173'
,
'node4'
,
'a'
,
'/root/'
))
#
self.tdnodes.append(Node(3, 'root', '52.247.207.173', 'node4', 'a', '/root/'))
self
.
tdnodes
.
append
(
Node
(
4
,
'root'
,
'51.141.166.100'
,
'node5'
,
'a'
,
'/root/'
))
#
self.tdnodes.append(Node(4, 'root', '51.141.166.100', 'node5', 'a', '/root/'))
def
stopOneNode
(
self
,
index
):
def
stopOneNode
(
self
,
index
):
self
.
tdnodes
[
index
].
stopTaosd
()
self
.
tdnodes
[
index
].
forceStopOneTaosd
()
self
.
tdnodes
[
index
].
forceStopOneTaosd
()
def
startOneNode
(
self
,
index
):
def
startOneNode
(
self
,
index
):
self
.
tdnodes
[
index
].
startOneTaosd
()
self
.
tdnodes
[
index
].
startOneTaosd
()
def
detectCoredumpFile
(
self
,
index
):
return
self
.
tdnodes
[
index
].
detectCoredumpFile
()
def
stopAllTaosd
(
self
):
def
stopAllTaosd
(
self
):
for
i
in
range
(
len
(
self
.
tdnodes
)):
for
i
in
range
(
len
(
self
.
tdnodes
)):
...
@@ -166,14 +183,32 @@ class Nodes:
...
@@ -166,14 +183,32 @@ class Nodes:
for
i
in
range
(
len
(
self
.
tdnodes
)):
for
i
in
range
(
len
(
self
.
tdnodes
)):
self
.
tdnodes
[
i
].
removeData
()
self
.
tdnodes
[
i
].
removeData
()
# kill taosd randomly every 10 mins
class
Test
:
nodes
=
Nodes
()
def
__init__
(
self
):
loop
=
0
self
.
nodes
=
Nodes
()
while
True
:
loop
=
loop
+
1
# kill taosd randomly every 10 mins
index
=
random
.
randint
(
0
,
4
)
def
randomlyKillDnode
(
self
):
print
(
"loop: %d, kill taosd on node%d"
%
(
loop
,
index
))
loop
=
0
nodes
.
stopOneNode
(
index
)
while
True
:
time
.
sleep
(
60
)
index
=
random
.
randint
(
0
,
4
)
nodes
.
startOneNode
(
index
)
print
(
"loop: %d, kill taosd on node%d"
%
(
loop
,
index
))
time
.
sleep
(
600
)
self
.
nodes
.
stopOneNode
(
index
)
\ No newline at end of file
time
.
sleep
(
60
)
self
.
nodes
.
startOneNode
(
index
)
time
.
sleep
(
600
)
loop
=
loop
+
1
def
detectCoredump
(
self
):
loop
=
0
while
True
:
for
i
in
range
(
len
(
self
.
nodes
.
tdnodes
)):
result
=
self
.
nodes
.
detectCoredumpFile
(
i
)
print
(
"core file path is %s"
%
result
)
if
result
and
not
result
.
isspace
():
self
.
nodes
.
stopAllTaosd
()
print
(
"sleep for 10 mins"
)
time
.
sleep
(
600
)
test
=
Test
()
test
.
detectCoredump
()
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录