Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
033b15cb
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
033b15cb
编写于
12月 24, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/develop' into feature/wal
上级
8d2d9b99
9f4a8ba7
变更
57
显示空白变更内容
内联
并排
Showing
57 changed file
with
232 addition
and
356 deletion
+232
-356
packaging/tools/set_core.sh
packaging/tools/set_core.sh
+24
-4
src/kit/taosdump/taosdump.c
src/kit/taosdump/taosdump.c
+3
-0
src/query/inc/qHistogram.h
src/query/inc/qHistogram.h
+1
-1
src/query/src/qHistogram.c
src/query/src/qHistogram.c
+0
-1
src/query/tests/histogramTest.cpp
src/query/tests/histogramTest.cpp
+5
-5
src/tsdb/src/tsdbCommit.c
src/tsdb/src/tsdbCommit.c
+5
-0
src/tsdb/src/tsdbMemTable.c
src/tsdb/src/tsdbMemTable.c
+13
-13
tests/pytest/crash_gen/crash_gen_main.py
tests/pytest/crash_gen/crash_gen_main.py
+11
-8
tests/pytest/crash_gen/db.py
tests/pytest/crash_gen/db.py
+9
-1
tests/pytest/crash_gen/misc.py
tests/pytest/crash_gen/misc.py
+2
-1
tests/pytest/crash_gen_bootstrap.py
tests/pytest/crash_gen_bootstrap.py
+1
-1
tests/pytest/import_merge/importCacheFileH.py
tests/pytest/import_merge/importCacheFileH.py
+1
-1
tests/pytest/import_merge/importCacheFileHO.py
tests/pytest/import_merge/importCacheFileHO.py
+1
-1
tests/pytest/import_merge/importCacheFileHPO.py
tests/pytest/import_merge/importCacheFileHPO.py
+1
-1
tests/pytest/import_merge/importCacheFileS.py
tests/pytest/import_merge/importCacheFileS.py
+1
-1
tests/pytest/import_merge/importCacheFileSub.py
tests/pytest/import_merge/importCacheFileSub.py
+1
-1
tests/pytest/import_merge/importCacheFileT.py
tests/pytest/import_merge/importCacheFileT.py
+1
-1
tests/pytest/import_merge/importCacheFileTO.py
tests/pytest/import_merge/importCacheFileTO.py
+1
-1
tests/pytest/import_merge/importCacheFileTPO.py
tests/pytest/import_merge/importCacheFileTPO.py
+1
-1
tests/pytest/import_merge/importDataH2.py
tests/pytest/import_merge/importDataH2.py
+1
-1
tests/pytest/import_merge/importDataHO.py
tests/pytest/import_merge/importDataHO.py
+1
-1
tests/pytest/import_merge/importDataHO2.py
tests/pytest/import_merge/importDataHO2.py
+1
-1
tests/pytest/import_merge/importDataHPO.py
tests/pytest/import_merge/importDataHPO.py
+1
-1
tests/pytest/import_merge/importDataLastH.py
tests/pytest/import_merge/importDataLastH.py
+1
-1
tests/pytest/import_merge/importDataLastHO.py
tests/pytest/import_merge/importDataLastHO.py
+1
-1
tests/pytest/import_merge/importDataLastHPO.py
tests/pytest/import_merge/importDataLastHPO.py
+1
-1
tests/pytest/import_merge/importDataLastS.py
tests/pytest/import_merge/importDataLastS.py
+1
-1
tests/pytest/import_merge/importDataLastSub.py
tests/pytest/import_merge/importDataLastSub.py
+3
-3
tests/pytest/import_merge/importDataLastT.py
tests/pytest/import_merge/importDataLastT.py
+1
-1
tests/pytest/import_merge/importDataLastTO.py
tests/pytest/import_merge/importDataLastTO.py
+1
-1
tests/pytest/import_merge/importDataLastTPO.py
tests/pytest/import_merge/importDataLastTPO.py
+1
-1
tests/pytest/import_merge/importDataS.py
tests/pytest/import_merge/importDataS.py
+1
-1
tests/pytest/import_merge/importDataSub.py
tests/pytest/import_merge/importDataSub.py
+1
-1
tests/pytest/import_merge/importDataT.py
tests/pytest/import_merge/importDataT.py
+1
-1
tests/pytest/import_merge/importDataTO.py
tests/pytest/import_merge/importDataTO.py
+1
-1
tests/pytest/import_merge/importDataTPO.py
tests/pytest/import_merge/importDataTPO.py
+2
-2
tests/pytest/import_merge/importHORestart.py
tests/pytest/import_merge/importHORestart.py
+1
-1
tests/pytest/import_merge/importHPORestart.py
tests/pytest/import_merge/importHPORestart.py
+1
-1
tests/pytest/import_merge/importHRestart.py
tests/pytest/import_merge/importHRestart.py
+1
-1
tests/pytest/import_merge/importInsertThenImport.py
tests/pytest/import_merge/importInsertThenImport.py
+1
-1
tests/pytest/import_merge/importLastH.py
tests/pytest/import_merge/importLastH.py
+1
-1
tests/pytest/import_merge/importLastHO.py
tests/pytest/import_merge/importLastHO.py
+1
-1
tests/pytest/import_merge/importLastHPO.py
tests/pytest/import_merge/importLastHPO.py
+1
-1
tests/pytest/import_merge/importLastS.py
tests/pytest/import_merge/importLastS.py
+1
-1
tests/pytest/import_merge/importLastSub.py
tests/pytest/import_merge/importLastSub.py
+1
-1
tests/pytest/import_merge/importLastT.py
tests/pytest/import_merge/importLastT.py
+1
-1
tests/pytest/import_merge/importLastTO.py
tests/pytest/import_merge/importLastTO.py
+1
-1
tests/pytest/import_merge/importLastTPO.py
tests/pytest/import_merge/importLastTPO.py
+1
-1
tests/pytest/import_merge/importSRestart.py
tests/pytest/import_merge/importSRestart.py
+1
-1
tests/pytest/import_merge/importSubRestart.py
tests/pytest/import_merge/importSubRestart.py
+1
-1
tests/pytest/import_merge/importTORestart.py
tests/pytest/import_merge/importTORestart.py
+1
-1
tests/pytest/import_merge/importTPORestart.py
tests/pytest/import_merge/importTPORestart.py
+1
-1
tests/pytest/import_merge/importTRestart.py
tests/pytest/import_merge/importTRestart.py
+1
-1
tests/pytest/query/query.py
tests/pytest/query/query.py
+20
-1
tests/script/jenkins/basic_3.txt
tests/script/jenkins/basic_3.txt
+32
-34
tests/script/unique/arbitrator/dn3_mn1_replica_change.sim
tests/script/unique/arbitrator/dn3_mn1_replica_change.sim
+53
-241
tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
...ipt/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
+8
-0
未找到文件。
packaging/tools/set_core.sh
浏览文件 @
033b15cb
...
@@ -2,19 +2,39 @@
...
@@ -2,19 +2,39 @@
#
#
# This file is used to set config for core when taosd crash
# This file is used to set config for core when taosd crash
# Color setting
RED
=
'\033[0;31m'
GREEN
=
'\033[1;32m'
GREEN_DARK
=
'\033[0;32m'
GREEN_UNDERLINE
=
'\033[4;32m'
NC
=
'\033[0m'
set
-e
set
-e
# set -x
# set -x
corePath
=
$1
csudo
=
""
csudo
=
""
if
command
-v
sudo
>
/dev/null
;
then
if
command
-v
sudo
>
/dev/null
;
then
csudo
=
"sudo"
csudo
=
"sudo"
fi
fi
#ulimit -c unlimited
if
[[
!
-n
${
corePath
}
]]
;
then
echo
-e
-n
"
${
GREEN
}
Please enter a file directory to save the coredump file
${
NC
}
:"
read
corePath
while
true
;
do
if
[[
!
-z
"
$corePath
"
]]
;
then
break
else
read
-p
"Please enter a file directory to save the coredump file:"
corePath
fi
done
fi
ulimit
-c
unlimited
${
csudo
}
sed
-i
'/ulimit -c unlimited/d'
/etc/profile
||
:
${
csudo
}
sed
-i
'/ulimit -c unlimited/d'
/etc/profile
||
:
${
csudo
}
sed
-i
'$a\ulimit -c unlimited'
/etc/profile
||
:
${
csudo
}
sed
-i
'$a\ulimit -c unlimited'
/etc/profile
||
:
source
/etc/profile
source
/etc/profile
${
csudo
}
mkdir
-p
/coredump
||
:
${
csudo
}
mkdir
-p
${
corePath
}
||
:
${
csudo
}
sysctl
-w
kernel.core_pattern
=
'/coredump/core-%e-%p'
||
:
${
csudo
}
sysctl
-w
kernel.core_pattern
=
${
corePath
}
/core-%e-%p
||
:
${
csudo
}
echo
'/coredump/core-%e-%p'
|
${
csudo
}
tee
/proc/sys/kernel/core_pattern
||
:
${
csudo
}
echo
"
${
corePath
}
/core-%e-%p"
|
${
csudo
}
tee
/proc/sys/kernel/core_pattern
||
:
src/kit/taosdump/taosdump.c
浏览文件 @
033b15cb
...
@@ -332,6 +332,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
...
@@ -332,6 +332,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
break
;
break
;
case
'N'
:
case
'N'
:
arguments
->
data_batch
=
atoi
(
arg
);
arguments
->
data_batch
=
atoi
(
arg
);
if
(
arguments
->
data_batch
>=
INT16_MAX
)
{
arguments
->
data_batch
=
INT16_MAX
-
1
;
}
break
;
break
;
case
'L'
:
case
'L'
:
{
{
...
...
src/query/inc/qHistogram.h
浏览文件 @
033b15cb
...
@@ -67,7 +67,7 @@ void tHistogramDestroy(SHistogramInfo** pHisto);
...
@@ -67,7 +67,7 @@ void tHistogramDestroy(SHistogramInfo** pHisto);
void
tHistogramPrint
(
SHistogramInfo
*
pHisto
);
void
tHistogramPrint
(
SHistogramInfo
*
pHisto
);
//
int32_t histoBinarySearch(SHistBin* pEntry, int32_t len, double val);
int32_t
histoBinarySearch
(
SHistBin
*
pEntry
,
int32_t
len
,
double
val
);
SHeapEntry
*
tHeapCreate
(
int32_t
numOfEntries
);
SHeapEntry
*
tHeapCreate
(
int32_t
numOfEntries
);
void
tHeapSort
(
SHeapEntry
*
pEntry
,
int32_t
len
);
void
tHeapSort
(
SHeapEntry
*
pEntry
,
int32_t
len
);
...
...
src/query/src/qHistogram.c
浏览文件 @
033b15cb
...
@@ -120,7 +120,6 @@
...
@@ -120,7 +120,6 @@
//}
//}
static
int32_t
histogramCreateBin
(
SHistogramInfo
*
pHisto
,
int32_t
index
,
double
val
);
static
int32_t
histogramCreateBin
(
SHistogramInfo
*
pHisto
,
int32_t
index
,
double
val
);
static
int32_t
histoBinarySearch
(
SHistBin
*
pEntry
,
int32_t
len
,
double
val
);
SHistogramInfo
*
tHistogramCreate
(
int32_t
numOfEntries
)
{
SHistogramInfo
*
tHistogramCreate
(
int32_t
numOfEntries
)
{
/* need one redundant slot */
/* need one redundant slot */
...
...
src/query/tests/histogramTest.cpp
浏览文件 @
033b15cb
...
@@ -21,19 +21,19 @@ TEST(testCase, histogram_binary_search) {
...
@@ -21,19 +21,19 @@ TEST(testCase, histogram_binary_search) {
pHisto
->
elems
[
i
].
val
=
i
;
pHisto
->
elems
[
i
].
val
=
i
;
}
}
int32_t
idx
=
vnodeHistob
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
1
);
int32_t
idx
=
histoB
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
1
);
assert
(
idx
==
1
);
assert
(
idx
==
1
);
idx
=
vnodeHistob
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
9
);
idx
=
histoB
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
9
);
assert
(
idx
==
9
);
assert
(
idx
==
9
);
idx
=
vnodeHistob
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
20
);
idx
=
histoB
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
20
);
assert
(
idx
==
10
);
assert
(
idx
==
10
);
idx
=
vnodeHistob
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
-
1
);
idx
=
histoB
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
-
1
);
assert
(
idx
==
0
);
assert
(
idx
==
0
);
idx
=
vnodeHistob
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
3.9
);
idx
=
histoB
inarySearch
(
pHisto
->
elems
,
pHisto
->
numOfEntries
,
3.9
);
assert
(
idx
==
4
);
assert
(
idx
==
4
);
free
(
pHisto
);
free
(
pHisto
);
...
...
src/tsdb/src/tsdbCommit.c
浏览文件 @
033b15cb
...
@@ -161,6 +161,11 @@ _err:
...
@@ -161,6 +161,11 @@ _err:
static
void
tsdbEndCommit
(
STsdbRepo
*
pRepo
,
int
eno
)
{
static
void
tsdbEndCommit
(
STsdbRepo
*
pRepo
,
int
eno
)
{
if
(
pRepo
->
appH
.
notifyStatus
)
pRepo
->
appH
.
notifyStatus
(
pRepo
->
appH
.
appH
,
TSDB_STATUS_COMMIT_OVER
,
eno
);
if
(
pRepo
->
appH
.
notifyStatus
)
pRepo
->
appH
.
notifyStatus
(
pRepo
->
appH
.
appH
,
TSDB_STATUS_COMMIT_OVER
,
eno
);
SMemTable
*
pIMem
=
pRepo
->
imem
;
tsdbLockRepo
(
pRepo
);
pRepo
->
imem
=
NULL
;
tsdbUnlockRepo
(
pRepo
);
tsdbUnRefMemTable
(
pRepo
,
pIMem
);
sem_post
(
&
(
pRepo
->
readyToCommit
));
sem_post
(
&
(
pRepo
->
readyToCommit
));
}
}
...
...
src/tsdb/src/tsdbMemTable.c
浏览文件 @
033b15cb
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include "tsdbMain.h"
#include "tsdbMain.h"
#define TSDB_DATA_SKIPLIST_LEVEL 5
#define TSDB_DATA_SKIPLIST_LEVEL 5
#define TSDB_MAX_INSERT_BATCH 512
static
SMemTable
*
tsdbNewMemTable
(
STsdbRepo
*
pRepo
);
static
SMemTable
*
tsdbNewMemTable
(
STsdbRepo
*
pRepo
);
static
void
tsdbFreeMemTable
(
SMemTable
*
pMemTable
);
static
void
tsdbFreeMemTable
(
SMemTable
*
pMemTable
);
...
@@ -205,7 +206,7 @@ void *tsdbAllocBytes(STsdbRepo *pRepo, int bytes) {
...
@@ -205,7 +206,7 @@ void *tsdbAllocBytes(STsdbRepo *pRepo, int bytes) {
int
tsdbAsyncCommit
(
STsdbRepo
*
pRepo
)
{
int
tsdbAsyncCommit
(
STsdbRepo
*
pRepo
)
{
if
(
pRepo
->
mem
==
NULL
)
return
0
;
if
(
pRepo
->
mem
==
NULL
)
return
0
;
SMemTable
*
pIMem
=
pRepo
->
imem
;
ASSERT
(
pRepo
->
imem
==
NULL
)
;
sem_wait
(
&
(
pRepo
->
readyToCommit
));
sem_wait
(
&
(
pRepo
->
readyToCommit
));
...
@@ -220,8 +221,6 @@ int tsdbAsyncCommit(STsdbRepo *pRepo) {
...
@@ -220,8 +221,6 @@ int tsdbAsyncCommit(STsdbRepo *pRepo) {
tsdbScheduleCommit
(
pRepo
);
tsdbScheduleCommit
(
pRepo
);
if
(
tsdbUnlockRepo
(
pRepo
)
<
0
)
return
-
1
;
if
(
tsdbUnlockRepo
(
pRepo
)
<
0
)
return
-
1
;
if
(
tsdbUnRefMemTable
(
pRepo
,
pIMem
)
<
0
)
return
-
1
;
return
0
;
return
0
;
}
}
...
@@ -606,19 +605,13 @@ static int tsdbInsertDataToTable(STsdbRepo *pRepo, SSubmitBlk *pBlock, int32_t *
...
@@ -606,19 +605,13 @@ static int tsdbInsertDataToTable(STsdbRepo *pRepo, SSubmitBlk *pBlock, int32_t *
STable
*
pTable
=
NULL
;
STable
*
pTable
=
NULL
;
SSubmitBlkIter
blkIter
=
{
0
};
SSubmitBlkIter
blkIter
=
{
0
};
SDataRow
row
=
NULL
;
SDataRow
row
=
NULL
;
void
*
*
rows
=
NULL
;
void
*
rows
[
TSDB_MAX_INSERT_BATCH
]
=
{
0
}
;
int
rowCounter
=
0
;
int
rowCounter
=
0
;
ASSERT
(
pBlock
->
tid
<
pMeta
->
maxTables
);
ASSERT
(
pBlock
->
tid
<
pMeta
->
maxTables
);
pTable
=
pMeta
->
tables
[
pBlock
->
tid
];
pTable
=
pMeta
->
tables
[
pBlock
->
tid
];
ASSERT
(
pTable
!=
NULL
&&
TABLE_UID
(
pTable
)
==
pBlock
->
uid
);
ASSERT
(
pTable
!=
NULL
&&
TABLE_UID
(
pTable
)
==
pBlock
->
uid
);
rows
=
(
void
**
)
calloc
(
pBlock
->
numOfRows
,
sizeof
(
void
*
));
if
(
rows
==
NULL
)
{
terrno
=
TSDB_CODE_TDB_OUT_OF_MEMORY
;
return
-
1
;
}
tsdbInitSubmitBlkIter
(
pBlock
,
&
blkIter
);
tsdbInitSubmitBlkIter
(
pBlock
,
&
blkIter
);
while
((
row
=
tsdbGetSubmitBlkNext
(
&
blkIter
))
!=
NULL
)
{
while
((
row
=
tsdbGetSubmitBlkNext
(
&
blkIter
))
!=
NULL
)
{
if
(
tsdbCopyRowToMem
(
pRepo
,
row
,
pTable
,
&
(
rows
[
rowCounter
]))
<
0
)
{
if
(
tsdbCopyRowToMem
(
pRepo
,
row
,
pTable
,
&
(
rows
[
rowCounter
]))
<
0
)
{
...
@@ -632,21 +625,28 @@ static int tsdbInsertDataToTable(STsdbRepo *pRepo, SSubmitBlk *pBlock, int32_t *
...
@@ -632,21 +625,28 @@ static int tsdbInsertDataToTable(STsdbRepo *pRepo, SSubmitBlk *pBlock, int32_t *
if
(
rows
[
rowCounter
]
!=
NULL
)
{
if
(
rows
[
rowCounter
]
!=
NULL
)
{
rowCounter
++
;
rowCounter
++
;
}
}
}
if
(
rowCounter
==
TSDB_MAX_INSERT_BATCH
)
{
if
(
tsdbInsertDataToTableImpl
(
pRepo
,
pTable
,
rows
,
rowCounter
)
<
0
)
{
if
(
tsdbInsertDataToTableImpl
(
pRepo
,
pTable
,
rows
,
rowCounter
)
<
0
)
{
goto
_err
;
goto
_err
;
}
}
rowCounter
=
0
;
memset
(
rows
,
0
,
sizeof
(
rows
));
}
}
if
(
rowCounter
>
0
&&
tsdbInsertDataToTableImpl
(
pRepo
,
pTable
,
rows
,
rowCounter
)
<
0
)
{
goto
_err
;
}
STSchema
*
pSchema
=
tsdbGetTableSchemaByVersion
(
pTable
,
pBlock
->
sversion
);
STSchema
*
pSchema
=
tsdbGetTableSchemaByVersion
(
pTable
,
pBlock
->
sversion
);
pRepo
->
stat
.
pointsWritten
+=
points
*
schemaNCols
(
pSchema
);
pRepo
->
stat
.
pointsWritten
+=
points
*
schemaNCols
(
pSchema
);
pRepo
->
stat
.
totalStorage
+=
points
*
schemaVLen
(
pSchema
);
pRepo
->
stat
.
totalStorage
+=
points
*
schemaVLen
(
pSchema
);
free
(
rows
);
return
0
;
return
0
;
_err:
_err:
free
(
rows
);
return
-
1
;
return
-
1
;
}
}
...
...
tests/pytest/crash_gen/crash_gen_main.py
浏览文件 @
033b15cb
...
@@ -2224,23 +2224,26 @@ class ClientManager:
...
@@ -2224,23 +2224,26 @@ class ClientManager:
if
svcMgr
:
# gConfig.auto_start_service:
if
svcMgr
:
# gConfig.auto_start_service:
svcMgr
.
stopTaosServices
()
svcMgr
.
stopTaosServices
()
svcMgr
=
None
svcMgr
=
None
# Print exec status, etc., AFTER showing messages from the server
self
.
conclude
()
# print("TC failed (2) = {}".format(self.tc.isFailed()))
# Linux return code: ref https://shapeshed.com/unix-exit-codes/
ret
=
1
if
self
.
tc
.
isFailed
()
else
0
self
.
tc
.
cleanup
()
# Release global variables
# Release global variables
gConfig
=
None
gConfig
=
None
gSvcMgr
=
None
gSvcMgr
=
None
logger
=
None
logger
=
None
# Release variables here
self
.
tc
=
None
thPool
=
None
thPool
=
None
dbManager
.
cleanUp
()
# destructor wouldn't run in time
dbManager
=
None
dbManager
=
None
# Print exec status, etc., AFTER showing messages from the server
self
.
conclude
()
# print("TC failed (2) = {}".format(self.tc.isFailed()))
# Linux return code: ref https://shapeshed.com/unix-exit-codes/
ret
=
1
if
self
.
tc
.
isFailed
()
else
0
self
.
tc
.
cleanup
()
# Release variables here
self
.
tc
=
None
gc
.
collect
()
# force garbage collection
gc
.
collect
()
# force garbage collection
# h = hpy()
# h = hpy()
# print("\n----- Final Python Heap -----\n")
# print("\n----- Final Python Heap -----\n")
...
...
tests/pytest/crash_gen/db.py
浏览文件 @
033b15cb
...
@@ -394,6 +394,7 @@ class DbManager():
...
@@ -394,6 +394,7 @@ class DbManager():
cType
==
'native'
)
else
DbConn
.
createRest
(
dbTarget
)
cType
==
'native'
)
else
DbConn
.
createRest
(
dbTarget
)
try
:
try
:
self
.
_dbConn
.
open
()
# may throw taos.error.ProgrammingError: disconnected
self
.
_dbConn
.
open
()
# may throw taos.error.ProgrammingError: disconnected
Logging
.
debug
(
"DbManager opened DB connection..."
)
except
taos
.
error
.
ProgrammingError
as
err
:
except
taos
.
error
.
ProgrammingError
as
err
:
# print("Error type: {}, msg: {}, value: {}".format(type(err), err.msg, err))
# print("Error type: {}, msg: {}, value: {}".format(type(err), err.msg, err))
if
(
err
.
msg
==
'client disconnected'
):
# cannot open DB connection
if
(
err
.
msg
==
'client disconnected'
):
# cannot open DB connection
...
@@ -412,6 +413,10 @@ class DbManager():
...
@@ -412,6 +413,10 @@ class DbManager():
# Moved to Database()
# Moved to Database()
# self._stateMachine = StateMechine(self._dbConn)
# self._stateMachine = StateMechine(self._dbConn)
def
__del__
(
self
):
''' Release the underlying DB connection upon deletion of DbManager '''
self
.
cleanUp
()
def
getDbConn
(
self
):
def
getDbConn
(
self
):
return
self
.
_dbConn
return
self
.
_dbConn
...
@@ -438,5 +443,8 @@ class DbManager():
...
@@ -438,5 +443,8 @@ class DbManager():
return
"table_{}"
.
format
(
tblNum
)
return
"table_{}"
.
format
(
tblNum
)
def
cleanUp
(
self
):
def
cleanUp
(
self
):
if
self
.
_dbConn
:
self
.
_dbConn
.
close
()
self
.
_dbConn
.
close
()
self
.
_dbConn
=
None
Logging
.
debug
(
"DbManager closed DB connection..."
)
tests/pytest/crash_gen/misc.py
浏览文件 @
033b15cb
...
@@ -2,6 +2,7 @@ import threading
...
@@ -2,6 +2,7 @@ import threading
import
random
import
random
import
logging
import
logging
import
os
import
os
import
sys
import
taos
import
taos
...
@@ -53,7 +54,7 @@ class Logging:
...
@@ -53,7 +54,7 @@ class Logging:
# global misc.logger
# global misc.logger
_logger
=
logging
.
getLogger
(
'CrashGen'
)
# real logger
_logger
=
logging
.
getLogger
(
'CrashGen'
)
# real logger
_logger
.
addFilter
(
LoggingFilter
())
_logger
.
addFilter
(
LoggingFilter
())
ch
=
logging
.
StreamHandler
(
)
ch
=
logging
.
StreamHandler
(
sys
.
stdout
)
# Ref: https://stackoverflow.com/questions/14058453/making-python-loggers-output-all-messages-to-stdout-in-addition-to-log-file
_logger
.
addHandler
(
ch
)
_logger
.
addHandler
(
ch
)
# Logging adapter, to be used as a logger
# Logging adapter, to be used as a logger
...
...
tests/pytest/crash_gen_bootstrap.py
浏览文件 @
033b15cb
...
@@ -19,5 +19,5 @@ if __name__ == "__main__":
...
@@ -19,5 +19,5 @@ if __name__ == "__main__":
mExec
.
init
()
mExec
.
init
()
exitCode
=
mExec
.
run
()
exitCode
=
mExec
.
run
()
print
(
"
Exiting with
code: {}"
.
format
(
exitCode
))
print
(
"
\n
Crash_Gen is now exiting with status
code: {}"
.
format
(
exitCode
))
sys
.
exit
(
exitCode
)
sys
.
exit
(
exitCode
)
tests/pytest/import_merge/importCacheFileH.py
浏览文件 @
033b15cb
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importCacheFileHO.py
浏览文件 @
033b15cb
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importCacheFileHPO.py
浏览文件 @
033b15cb
...
@@ -57,7 +57,7 @@ class TDTestCase:
...
@@ -57,7 +57,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importCacheFileS.py
浏览文件 @
033b15cb
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importCacheFileSub.py
浏览文件 @
033b15cb
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importCacheFileT.py
浏览文件 @
033b15cb
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importCacheFileTO.py
浏览文件 @
033b15cb
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importCacheFileTPO.py
浏览文件 @
033b15cb
...
@@ -57,7 +57,7 @@ class TDTestCase:
...
@@ -57,7 +57,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataH2.py
浏览文件 @
033b15cb
...
@@ -59,7 +59,7 @@ class TDTestCase:
...
@@ -59,7 +59,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataHO.py
浏览文件 @
033b15cb
...
@@ -60,7 +60,7 @@ class TDTestCase:
...
@@ -60,7 +60,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataHO2.py
浏览文件 @
033b15cb
...
@@ -60,7 +60,7 @@ class TDTestCase:
...
@@ -60,7 +60,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataHPO.py
浏览文件 @
033b15cb
...
@@ -62,7 +62,7 @@ class TDTestCase:
...
@@ -62,7 +62,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataLastH.py
浏览文件 @
033b15cb
...
@@ -59,7 +59,7 @@ class TDTestCase:
...
@@ -59,7 +59,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataLastHO.py
浏览文件 @
033b15cb
...
@@ -59,7 +59,7 @@ class TDTestCase:
...
@@ -59,7 +59,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataLastHPO.py
浏览文件 @
033b15cb
...
@@ -61,7 +61,7 @@ class TDTestCase:
...
@@ -61,7 +61,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataLastS.py
浏览文件 @
033b15cb
...
@@ -59,7 +59,7 @@ class TDTestCase:
...
@@ -59,7 +59,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataLastSub.py
浏览文件 @
033b15cb
...
@@ -32,7 +32,7 @@ class TDTestCase:
...
@@ -32,7 +32,7 @@ class TDTestCase:
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'drop database if exists db'
)
...
@@ -60,9 +60,9 @@ class TDTestCase:
...
@@ -60,9 +60,9 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 10 data totally repetitive"
)
tdLog
.
info
(
"import 10 data totally repetitive"
)
...
...
tests/pytest/import_merge/importDataLastT.py
浏览文件 @
033b15cb
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataLastTO.py
浏览文件 @
033b15cb
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataLastTPO.py
浏览文件 @
033b15cb
...
@@ -57,7 +57,7 @@ class TDTestCase:
...
@@ -57,7 +57,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataS.py
浏览文件 @
033b15cb
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataSub.py
浏览文件 @
033b15cb
...
@@ -60,7 +60,7 @@ class TDTestCase:
...
@@ -60,7 +60,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataT.py
浏览文件 @
033b15cb
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataTO.py
浏览文件 @
033b15cb
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importDataTPO.py
浏览文件 @
033b15cb
...
@@ -57,9 +57,9 @@ class TDTestCase:
...
@@ -57,9 +57,9 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 20 data later with partly overlap"
)
tdLog
.
info
(
"import 20 data later with partly overlap"
)
...
...
tests/pytest/import_merge/importHORestart.py
浏览文件 @
033b15cb
...
@@ -57,7 +57,7 @@ class TDTestCase:
...
@@ -57,7 +57,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/import_merge/importHPORestart.py
浏览文件 @
033b15cb
...
@@ -62,7 +62,7 @@ class TDTestCase:
...
@@ -62,7 +62,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/import_merge/importHRestart.py
浏览文件 @
033b15cb
...
@@ -54,7 +54,7 @@ class TDTestCase:
...
@@ -54,7 +54,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/import_merge/importInsertThenImport.py
浏览文件 @
033b15cb
...
@@ -61,7 +61,7 @@ class TDTestCase:
...
@@ -61,7 +61,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"import 100 sequential data again"
)
tdLog
.
info
(
"import 100 sequential data again"
)
...
...
tests/pytest/import_merge/importLastH.py
浏览文件 @
033b15cb
...
@@ -53,7 +53,7 @@ class TDTestCase:
...
@@ -53,7 +53,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importLastHO.py
浏览文件 @
033b15cb
...
@@ -53,7 +53,7 @@ class TDTestCase:
...
@@ -53,7 +53,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importLastHPO.py
浏览文件 @
033b15cb
...
@@ -55,7 +55,7 @@ class TDTestCase:
...
@@ -55,7 +55,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importLastS.py
浏览文件 @
033b15cb
...
@@ -53,7 +53,7 @@ class TDTestCase:
...
@@ -53,7 +53,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importLastSub.py
浏览文件 @
033b15cb
...
@@ -53,7 +53,7 @@ class TDTestCase:
...
@@ -53,7 +53,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importLastT.py
浏览文件 @
033b15cb
...
@@ -57,7 +57,7 @@ class TDTestCase:
...
@@ -57,7 +57,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importLastTO.py
浏览文件 @
033b15cb
...
@@ -57,7 +57,7 @@ class TDTestCase:
...
@@ -57,7 +57,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importLastTPO.py
浏览文件 @
033b15cb
...
@@ -59,7 +59,7 @@ class TDTestCase:
...
@@ -59,7 +59,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
#
tdLog.sleep(5)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
...
...
tests/pytest/import_merge/importSRestart.py
浏览文件 @
033b15cb
...
@@ -64,7 +64,7 @@ class TDTestCase:
...
@@ -64,7 +64,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/import_merge/importSubRestart.py
浏览文件 @
033b15cb
...
@@ -64,7 +64,7 @@ class TDTestCase:
...
@@ -64,7 +64,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/import_merge/importTORestart.py
浏览文件 @
033b15cb
...
@@ -64,7 +64,7 @@ class TDTestCase:
...
@@ -64,7 +64,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/import_merge/importTPORestart.py
浏览文件 @
033b15cb
...
@@ -68,7 +68,7 @@ class TDTestCase:
...
@@ -68,7 +68,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/import_merge/importTRestart.py
浏览文件 @
033b15cb
...
@@ -61,7 +61,7 @@ class TDTestCase:
...
@@ -61,7 +61,7 @@ class TDTestCase:
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
#
tdLog.sleep(10)
tdLog
.
info
(
"================= step6"
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
query
(
'select * from tb1'
)
...
...
tests/pytest/query/query.py
浏览文件 @
033b15cb
...
@@ -16,7 +16,7 @@ import taos
...
@@ -16,7 +16,7 @@ import taos
from
util.log
import
tdLog
from
util.log
import
tdLog
from
util.cases
import
tdCases
from
util.cases
import
tdCases
from
util.sql
import
tdSql
from
util.sql
import
tdSql
from
util.dnodes
import
tdDnodes
class
TDTestCase
:
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
...
@@ -44,6 +44,25 @@ class TDTestCase:
...
@@ -44,6 +44,25 @@ class TDTestCase:
tdSql
.
query
(
"select * from db.st where ts='2020-05-13 10:00:00.000'"
)
tdSql
.
query
(
"select * from db.st where ts='2020-05-13 10:00:00.000'"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkRows
(
1
)
## test case for https://jira.taosdata.com:18080/browse/TD-2488
tdSql
.
execute
(
"create table m1(ts timestamp, k int) tags(a int)"
)
tdSql
.
execute
(
"create table t1 using m1 tags(1)"
)
tdSql
.
execute
(
"create table t2 using m1 tags(2)"
)
tdSql
.
execute
(
"insert into t1 values('2020-1-1 1:1:1', 1)"
)
tdSql
.
execute
(
"insert into t1 values('2020-1-1 1:10:1', 2)"
)
tdSql
.
execute
(
"insert into t2 values('2020-1-1 1:5:1', 99)"
)
tdSql
.
query
(
"select count(*) from m1 where ts = '2020-1-1 1:5:1' "
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
query
(
"select count(*) from m1 where ts = '2020-1-1 1:5:1' "
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
1
)
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
...
...
tests/script/jenkins/basic_3.txt
浏览文件 @
033b15cb
./test.sh -f unique/stable/balance_replica1.sim
./test.sh -f unique/stable/dnode2_stop.sim
./test.sh -f unique/stable/dnode2.sim
./test.sh -f unique/stable/dnode3.sim
./test.sh -f unique/stable/replica2_dnode4.sim
./test.sh -f unique/stable/replica2_vnode3.sim
./test.sh -f unique/stable/replica3_dnode6.sim
./test.sh -f unique/stable/replica3_vnode3.sim
./test.sh -f unique/mnode/mgmt20.sim
./test.sh -f unique/mnode/mgmt21.sim
./test.sh -f unique/mnode/mgmt22.sim
./test.sh -f unique/mnode/mgmt23.sim
./test.sh -f unique/mnode/mgmt24.sim
#./test.sh -f unique/mnode/mgmt25.sim
#./test.sh -f unique/mnode/mgmt26.sim
./test.sh -f unique/mnode/mgmt33.sim
./test.sh -f unique/mnode/mgmt34.sim
./test.sh -f unique/mnode/mgmtr2.sim
./test.sh -f general/parser/stream_on_sys.sim
./test.sh -f general/stream/metrics_del.sim
./test.sh -f general/stream/metrics_n.sim
./test.sh -f general/stream/metrics_replica1_vnoden.sim
./test.sh -f general/stream/restart_stream.sim
./test.sh -f general/stream/stream_3.sim
./test.sh -f general/stream/stream_restart.sim
./test.sh -f general/stream/table_1.sim
./test.sh -f general/stream/table_del.sim
./test.sh -f general/stream/table_n.sim
./test.sh -f general/stream/table_replica1_vnoden.sim
./test.sh -f unique/arbitrator/check_cluster_cfg_para.sim
./test.sh -f unique/arbitrator/check_cluster_cfg_para.sim
#./test.sh -f unique/arbitrator/dn2_mn1_cache_file_sync.sim
#./test.sh -f unique/arbitrator/dn2_mn1_cache_file_sync.sim
./test.sh -f unique/arbitrator/dn3_mn1_full_createTableFail.sim
./test.sh -f unique/arbitrator/dn3_mn1_full_createTableFail.sim
...
@@ -79,3 +45,35 @@
...
@@ -79,3 +45,35 @@
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
./test.sh -f unique/stable/balance_replica1.sim
./test.sh -f unique/stable/dnode2_stop.sim
./test.sh -f unique/stable/dnode2.sim
./test.sh -f unique/stable/dnode3.sim
./test.sh -f unique/stable/replica2_dnode4.sim
./test.sh -f unique/stable/replica2_vnode3.sim
./test.sh -f unique/stable/replica3_dnode6.sim
./test.sh -f unique/stable/replica3_vnode3.sim
./test.sh -f unique/mnode/mgmt20.sim
./test.sh -f unique/mnode/mgmt21.sim
./test.sh -f unique/mnode/mgmt22.sim
./test.sh -f unique/mnode/mgmt23.sim
./test.sh -f unique/mnode/mgmt24.sim
#./test.sh -f unique/mnode/mgmt25.sim
#./test.sh -f unique/mnode/mgmt26.sim
./test.sh -f unique/mnode/mgmt33.sim
./test.sh -f unique/mnode/mgmt34.sim
./test.sh -f unique/mnode/mgmtr2.sim
./test.sh -f general/parser/stream_on_sys.sim
./test.sh -f general/stream/metrics_del.sim
./test.sh -f general/stream/metrics_n.sim
./test.sh -f general/stream/metrics_replica1_vnoden.sim
./test.sh -f general/stream/restart_stream.sim
./test.sh -f general/stream/stream_3.sim
./test.sh -f general/stream/stream_restart.sim
./test.sh -f general/stream/table_1.sim
./test.sh -f general/stream/table_del.sim
./test.sh -f general/stream/table_n.sim
./test.sh -f general/stream/table_replica1_vnoden.sim
tests/script/unique/arbitrator/dn3_mn1_replica_change.sim
浏览文件 @
033b15cb
...
@@ -55,7 +55,7 @@ $x = 0
...
@@ -55,7 +55,7 @@ $x = 0
step1:
step1:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x ==
1
0 then
if $x ==
4
0 then
return -1
return -1
endi
endi
...
@@ -106,63 +106,20 @@ endi
...
@@ -106,63 +106,20 @@ endi
print ============== step2-1: stop dnode2 for falling disc, then restart dnode2, and check rows
print ============== step2-1: stop dnode2 for falling disc, then restart dnode2, and check rows
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
$loopCnt = 0
wait_dnode2_offline_0:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
endi
sql show dnodes
if $rows != 2 then
sleep 2000
goto wait_dnode2_offline_0
endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
#$dnode1Status = $data4_1
$dnode2Status = $data4_2
#$dnode3Status = $data4_3
#$dnode4Status = $data4_4
#$dnode5Status = $data4_5
if $dnode2Status != offline then
sleep 2000
goto wait_dnode2_offline_0
endi
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode2 -s start
$loopCnt = 0
$x = 0
wait_dnode2_reready:
a0:
$loopCnt = $loopCnt + 1
$x = $x + 1
if $loopCnt == 10 then
sleep 1000
if $x == 40 then
return -1
return -1
endi
endi
sql show dnodes
if $rows != 2 then
sql show vgroups
sleep 2000
print online vnodes $data03
goto wait_dnode2_reready
if $data03 != 1 then
endi
goto a0
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
#$dnode1Status = $data4_1
$dnode2Status = $data4_2
#$dnode3Status = $data4_3
#$dnode4Status = $data4_4
#$dnode5Status = $data4_5
if $dnode2Status != ready then
sleep 2000
goto wait_dnode2_reready
endi
endi
sql select count(*) from $stb
sql select count(*) from $stb
...
@@ -179,7 +136,7 @@ $x = 0
...
@@ -179,7 +136,7 @@ $x = 0
step2:
step2:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x ==
1
0 then
if $x ==
4
0 then
return -1
return -1
endi
endi
...
@@ -217,37 +174,18 @@ endi
...
@@ -217,37 +174,18 @@ endi
print ============== step4: stop dnode2 for checking if sync ok
print ============== step4: stop dnode2 for checking if sync ok
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode2 -s stop
$loopCnt = 0
$x = 0
wait_dnode2_offline:
a2:
$loopCnt = $loopCnt + 1
$x = $x + 1
if $loopCnt == 10 then
sleep 1000
if $x == 40 then
return -1
return -1
endi
endi
sql show dnodes
sql show vgroups
if $rows != 3 then
print online vnodes $data03
sleep 2000
if $data03 != 1 then
goto wait_dnode2_offline
goto a2
endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
#$dnode1Status = $data4_1
$dnode2Status = $data4_2
$dnode3Status = $data4_3
#$dnode4Status = $data4_4
#$dnode5Status = $data4_5
if $dnode2Status != offline then
sleep 2000
goto wait_dnode2_offline
endi
if $dnode3Status != ready then
sleep 2000
goto wait_dnode2_offline
endi
endi
# check using select
# check using select
...
@@ -260,7 +198,7 @@ endi
...
@@ -260,7 +198,7 @@ endi
print ============== step5: restart dnode2
print ============== step5: restart dnode2
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode2 -s start
$x = 0
$x = 0
a
2
:
a
3
:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 40 then
if $x == 40 then
...
@@ -270,7 +208,7 @@ a2:
...
@@ -270,7 +208,7 @@ a2:
sql show vgroups
sql show vgroups
print online vnodes $data03
print online vnodes $data03
if $data03 != 2 then
if $data03 != 2 then
goto a
2
goto a
3
endi
endi
# check using select
# check using select
...
@@ -303,7 +241,7 @@ endi
...
@@ -303,7 +241,7 @@ endi
sql alter database $db replica 3
sql alter database $db replica 3
$x = 0
$x = 0
a
3
:
a
4
:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 40 then
if $x == 40 then
...
@@ -313,7 +251,7 @@ a3:
...
@@ -313,7 +251,7 @@ a3:
sql show vgroups
sql show vgroups
print online vnodes $data03
print online vnodes $data03
if $data03 != 3 then
if $data03 != 3 then
goto a
3
goto a
4
endi
endi
# check using select
# check using select
...
@@ -325,44 +263,8 @@ endi
...
@@ -325,44 +263,8 @@ endi
print ============== step7: alter replica from 3 to 2, and waiting sync
print ============== step7: alter replica from 3 to 2, and waiting sync
sql alter database $db replica 2
sql alter database $db replica 2
$loopCnt = 0
wait_vgroups_replic_to_2:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
endi
sql show vgroups
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 $data10_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 $data10_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 $data10_3
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 $data5_4 $data6_4 $data7_4 $data8_4 $data9_4 $data10_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
$thirdDnode_2 = $data8_1
$thirdDnode_3 = $data8_2
$thirdDnode_4 = $data8_3
$thirdDnode_5 = $data8_4
if $thirdDnode_2 != null then
sleep 2000
goto wait_vgroups_replic_to_2
endi
if $thirdDnode_3 != null then
sleep 2000
goto wait_vgroups_replic_to_2
endi
if $thirdDnode_4 != null then
sleep 2000
goto wait_vgroups_replic_to_2
endi
if $thirdDnode_5 != null then
sleep 2000
goto wait_vgroups_replic_to_2
endi
$x = 0
$x = 0
a
4
:
a
5
:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 40 then
if $x == 40 then
...
@@ -372,7 +274,7 @@ a4:
...
@@ -372,7 +274,7 @@ a4:
sql show vgroups
sql show vgroups
print online vnodes $data03
print online vnodes $data03
if $data03 != 2 then
if $data03 != 2 then
goto a
4
goto a
5
endi
endi
# check using select
# check using select
...
@@ -384,86 +286,8 @@ endi
...
@@ -384,86 +286,8 @@ endi
print ============== step8: alter replica from 2 to 1, and waiting sync
print ============== step8: alter replica from 2 to 1, and waiting sync
sql alter database $db replica 1
sql alter database $db replica 1
sleep 10000
$loopCnt = 0
wait_vgroups_replic_to_1:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
endi
sql show vgroups
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 $data5_4 $data6_4 $data7_4 $data8_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
$sencodDnode_2 = $data6_1
$sencodDnode_3 = $data6_2
$sencodDnode_4 = $data6_3
$sencodDnode_5 = $data6_4
if $sencodDnode_2 != null then
sleep 2000
goto wait_vgroups_replic_to_1
endi
if $sencodDnode_3 != null then
sleep 2000
goto wait_vgroups_replic_to_1
endi
if $sencodDnode_4 != null then
sleep 2000
goto wait_vgroups_replic_to_1
endi
if $sencodDnode_5 != null then
sleep 2000
goto wait_vgroups_replic_to_1
endi
$loopCnt = 0
all_dnodes_ready:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
endi
sql show dnodes
if $rows != 4 then
sleep 2000
goto all_dnodes_ready
endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
$dnode1Status = $data4_1
$dnode2Status = $data4_2
$dnode3Status = $data4_3
$dnode4Status = $data4_4
#$dnode5Status = $data4_5
if $dnode1Status != ready then
sleep 2000
goto all_dnodes_ready
endi
if $dnode2Status != ready then
sleep 2000
goto all_dnodes_ready
endi
if $dnode3Status != ready then
sleep 2000
goto all_dnodes_ready
endi
if $dnode4Status != ready then
sleep 2000
goto all_dnodes_ready
endi
$x = 0
$x = 0
a
5
:
a
6
:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 40 then
if $x == 40 then
...
@@ -473,7 +297,7 @@ a5:
...
@@ -473,7 +297,7 @@ a5:
sql show vgroups
sql show vgroups
print online vnodes $data03
print online vnodes $data03
if $data03 != 1 then
if $data03 != 1 then
goto a
5
goto a
6
endi
endi
# check using select
# check using select
...
@@ -488,43 +312,21 @@ sql drop dnode $hostname2
...
@@ -488,43 +312,21 @@ sql drop dnode $hostname2
sql drop dnode $hostname3
sql drop dnode $hostname3
sleep $sleepTimer
sleep $sleepTimer
$loopCnt = 0
$x = 0
wait_dnode23_dropped:
step9:
$loopCnt = $loopCnt + 1
$x = $x + 1
if $loopCnt == 10 then
sleep 1000
if $x == 40 then
return -1
return -1
endi
endi
sql show dnodes
sql show dnodes
if $rows != 2 then
if $rows != 2 then
sleep 2000
goto step9
goto wait_dnode23_dropped
endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
$dnode1Status = $data4_1
$dnode2Status = $data4_2
$dnode3Status = $data4_3
$dnode4Status = $data4_4
if $dnode2Status != null then
sleep 2000
goto wait_dnode23_dropped
endi
if $dnode3Status != null then
sleep 2000
goto wait_dnode23_dropped
endi
if $dnode4Status != ready then
return -1
endi
endi
$x = 0
$x = 0
a
6
:
a
7
:
$x = $x + 1
$x = $x + 1
sleep 1000
sleep 1000
if $x == 40 then
if $x == 40 then
...
@@ -534,7 +336,7 @@ a6:
...
@@ -534,7 +336,7 @@ a6:
sql show vgroups
sql show vgroups
print online vnodes $data03
print online vnodes $data03
if $data03 != 1 then
if $data03 != 1 then
goto a
6
goto a
7
endi
endi
sleep $sleepTimer #waiting move vnode from dnode3/dnode3 to dnode4
sleep $sleepTimer #waiting move vnode from dnode3/dnode3 to dnode4
...
@@ -544,3 +346,13 @@ print data00 $data00
...
@@ -544,3 +346,13 @@ print data00 $data00
if $data00 != $totalRows then
if $data00 != $totalRows then
return -1
return -1
endi
endi
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 dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
浏览文件 @
033b15cb
...
@@ -140,3 +140,11 @@ if $data00 != $totalRows then
...
@@ -140,3 +140,11 @@ if $data00 != $totalRows then
return -1
return -1
endi
endi
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 dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录