Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
codyshao
TDengine
提交
5b3c019f
T
TDengine
项目概览
codyshao
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
2
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5b3c019f
编写于
5月 15, 2020
作者:
S
Shuduo Sang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into feature/add-testcase-to-test-boundary
上级
6b8aae25
100c7ed4
变更
28
隐藏空白更改
内联
并排
Showing
28 changed file
with
351 addition
and
295 deletion
+351
-295
.travis.yml
.travis.yml
+3
-3
src/plugins/monitor/src/monitorMain.c
src/plugins/monitor/src/monitorMain.c
+5
-0
src/tsdb/inc/tsdbMain.h
src/tsdb/inc/tsdbMain.h
+11
-11
src/tsdb/src/tsdbMain.c
src/tsdb/src/tsdbMain.c
+6
-5
src/tsdb/src/tsdbMeta.c
src/tsdb/src/tsdbMeta.c
+8
-7
src/util/inc/tskiplist.h
src/util/inc/tskiplist.h
+5
-6
src/util/src/tskiplist.c
src/util/src/tskiplist.c
+139
-111
src/util/tests/skiplistTest.cpp
src/util/tests/skiplistTest.cpp
+39
-18
tests/pytest/insert/float.py
tests/pytest/insert/float.py
+4
-4
tests/pytest/insert/int.py
tests/pytest/insert/int.py
+5
-5
tests/pytest/smoketest.sh
tests/pytest/smoketest.sh
+0
-2
tests/pytest/test.py
tests/pytest/test.py
+2
-1
tests/pytest/util/cases.py
tests/pytest/util/cases.py
+1
-3
tests/pytest/util/dnodes.py
tests/pytest/util/dnodes.py
+2
-2
tests/pytest/valgrind-test.sh
tests/pytest/valgrind-test.sh
+0
-2
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+28
-28
tests/script/unique/cluster/balance1.sim
tests/script/unique/cluster/balance1.sim
+4
-4
tests/script/unique/cluster/balance2.sim
tests/script/unique/cluster/balance2.sim
+6
-6
tests/script/unique/cluster/balance3.sim
tests/script/unique/cluster/balance3.sim
+4
-4
tests/script/unique/cluster/cache.sim
tests/script/unique/cluster/cache.sim
+14
-15
tests/script/unique/db/replica_add13.sim
tests/script/unique/db/replica_add13.sim
+28
-24
tests/script/unique/dnode/balance1.sim
tests/script/unique/dnode/balance1.sim
+11
-11
tests/script/unique/dnode/balance2.sim
tests/script/unique/dnode/balance2.sim
+9
-9
tests/script/unique/dnode/balance3.sim
tests/script/unique/dnode/balance3.sim
+4
-4
tests/script/unique/dnode/balancex.sim
tests/script/unique/dnode/balancex.sim
+4
-4
tests/script/unique/dnode/offline1.sim
tests/script/unique/dnode/offline1.sim
+1
-1
tests/script/unique/dnode/offline2.sim
tests/script/unique/dnode/offline2.sim
+5
-2
tests/script/unique/stable/dnode3.sim
tests/script/unique/stable/dnode3.sim
+3
-3
未找到文件。
.travis.yml
浏览文件 @
5b3c019f
...
...
@@ -50,7 +50,7 @@ matrix:
./test-all.sh $TRAVIS_EVENT_TYPE || travis_terminate $?
cd ${TRAVIS_BUILD_DIR}/tests/pytest
./valgrind-test.sh -g 2>&1
| tee
mem-error-out.txt
./valgrind-test.sh -g 2>&1
>
mem-error-out.txt
sleep 1
# Color setting
...
...
@@ -60,7 +60,7 @@ matrix:
GREEN_UNDERLINE='\033[4;32m'
NC='\033[0m'
grep 'ERROR SUMMARY' mem-error-out.txt|grep -v 'grep'|uniq|tee uniq-mem-error-out.txt
grep '
start to execute\|
ERROR SUMMARY' mem-error-out.txt|grep -v 'grep'|uniq|tee uniq-mem-error-out.txt
for memError in `cat uniq-mem-error-out.txt | awk '{print $4}'`
do
...
...
@@ -73,7 +73,7 @@ matrix:
fi
done
grep 'definitely lost:' mem-error-out.txt|grep -v 'grep'|uniq|tee uniq-definitely-lost-out.txt
grep '
start to execute\|
definitely lost:' mem-error-out.txt|grep -v 'grep'|uniq|tee uniq-definitely-lost-out.txt
for defiMemError in `cat uniq-definitely-lost-out.txt | awk '{print $7}'`
do
if [ -n "$defiMemError" ]; then
...
...
src/plugins/monitor/src/monitorMain.c
浏览文件 @
5b3c019f
...
...
@@ -109,6 +109,11 @@ static void monitorStartSystemRetry() {
}
static
void
monitorInitConn
(
void
*
para
,
void
*
unused
)
{
if
(
dnodeGetDnodeId
()
<=
0
)
{
monitorStartSystemRetry
();
return
;
}
monitorPrint
(
"starting to initialize monitor service .."
);
tsMonitorConn
.
state
=
MONITOR_STATE_INITIALIZING
;
...
...
src/tsdb/inc/tsdbMain.h
浏览文件 @
5b3c019f
...
...
@@ -29,23 +29,23 @@ extern "C" {
extern
int
tsdbDebugFlag
;
#define tsdbError(...)
\
if (tsdbDebugFlag & DEBUG_ERROR) {
\
taosPrintLog("ERROR T
S
DB ", tsdbDebugFlag, __VA_ARGS__); \
#define tsdbError(...) \
if (tsdbDebugFlag & DEBUG_ERROR) { \
taosPrintLog("ERROR TDB ", tsdbDebugFlag, __VA_ARGS__); \
}
#define tsdbWarn(...)
\
if (tsdbDebugFlag & DEBUG_WARN) {
\
taosPrintLog("WARN T
S
DB ", tsdbDebugFlag, __VA_ARGS__); \
#define tsdbWarn(...) \
if (tsdbDebugFlag & DEBUG_WARN) { \
taosPrintLog("WARN TDB ", tsdbDebugFlag, __VA_ARGS__); \
}
#define tsdbTrace(...)
\
if (tsdbDebugFlag & DEBUG_TRACE) {
\
taosPrintLog("T
S
DB ", tsdbDebugFlag, __VA_ARGS__); \
#define tsdbTrace(...) \
if (tsdbDebugFlag & DEBUG_TRACE) { \
taosPrintLog("TDB ", tsdbDebugFlag, __VA_ARGS__); \
}
#define tsdbPrint(...) \
{ taosPrintLog("T
S
DB ", 255, __VA_ARGS__); }
{ taosPrintLog("TDB ", 255, __VA_ARGS__); }
// ------------------------------ TSDB META FILE INTERFACES ------------------------------
#define TSDB_META_FILE_NAME "
META
"
#define TSDB_META_FILE_NAME "
meta
"
#define TSDB_META_HASH_FRACTION 1.1
typedef
int
(
*
iterFunc
)(
void
*
,
void
*
cont
,
int
contLen
);
...
...
src/tsdb/src/tsdbMain.c
浏览文件 @
5b3c019f
...
...
@@ -18,7 +18,7 @@ int tsdbDebugFlag = 135;
#define TSDB_MIN_ID 0
#define TSDB_MAX_ID INT_MAX
#define TSDB_CFG_FILE_NAME "
CONFIG
"
#define TSDB_CFG_FILE_NAME "
config
"
#define TSDB_DATA_DIR_NAME "data"
#define TSDB_DEFAULT_FILE_BLOCK_ROW_OPTION 0.7
#define TSDB_MAX_LAST_FILE_SIZE (1024 * 1024 * 10) // 10M
...
...
@@ -169,6 +169,7 @@ static int tsdbRestoreInfo(STsdbRepo *pRepo) {
if
(
tsdbSetAndOpenHelperFile
(
&
rhelper
,
pFGroup
)
<
0
)
goto
_err
;
for
(
int
i
=
1
;
i
<
pRepo
->
config
.
maxTables
;
i
++
)
{
STable
*
pTable
=
pMeta
->
tables
[
i
];
if
(
pTable
==
NULL
)
continue
;
SCompIdx
*
pIdx
=
&
rhelper
.
pCompIdx
[
i
];
if
(
pIdx
->
offset
>
0
&&
pTable
->
lastKey
<
pIdx
->
maxKey
)
pTable
->
lastKey
=
pIdx
->
maxKey
;
...
...
@@ -841,8 +842,8 @@ static int32_t tdInsertRowToTable(STsdbRepo *pRepo, SDataRow row, STable *pTable
pTable
->
mem
->
numOfPoints
=
tSkipListGetSize
(
pTable
->
mem
->
pData
);
tsdbTrace
(
"vgId:%d, tid:%d, uid:%"
PRId64
",
a row is inserted to table! key:%"
PRId64
,
p
Repo
->
config
.
tsdbId
,
pTable
->
tableId
.
tid
,
pTable
->
tableId
.
uid
,
dataRowKey
(
row
));
tsdbTrace
(
"vgId:%d, tid:%d, uid:%"
PRId64
",
table:%s a row is inserted to table! key:%"
PRId64
,
pRepo
->
config
.
tsdbId
,
p
Table
->
tableId
.
tid
,
pTable
->
tableId
.
uid
,
varDataVal
(
pTable
->
name
)
,
dataRowKey
(
row
));
return
0
;
}
...
...
@@ -867,9 +868,9 @@ static int32_t tsdbInsertDataToTable(TsdbRepoT *repo, SSubmitBlk *pBlock, TSKEY
tsdbInitSubmitBlkIter
(
pBlock
,
&
blkIter
);
while
((
row
=
tsdbGetSubmitBlkNext
(
&
blkIter
))
!=
NULL
)
{
if
(
dataRowKey
(
row
)
<
minKey
||
dataRowKey
(
row
)
>
maxKey
)
{
tsdbError
(
"vgId:%d, table tid:%d, talbe uid:%ld timestamp is out of range. now:"
PRId64
", maxKey:"
PRId64
tsdbError
(
"vgId:%d, table
:%s,
tid:%d, talbe uid:%ld timestamp is out of range. now:"
PRId64
", maxKey:"
PRId64
", minKey:"
PRId64
,
pRepo
->
config
.
tsdbId
,
pTable
->
tableId
.
tid
,
pTable
->
tableId
.
uid
,
now
,
minKey
,
maxKey
);
pRepo
->
config
.
tsdbId
,
varDataVal
(
pTable
->
name
),
pTable
->
tableId
.
tid
,
pTable
->
tableId
.
uid
,
now
,
minKey
,
maxKey
);
return
TSDB_CODE_TIMESTAMP_OUT_OF_RANGE
;
}
...
...
src/tsdb/src/tsdbMeta.c
浏览文件 @
5b3c019f
...
...
@@ -6,7 +6,7 @@
#include "tsdbMain.h"
#define TSDB_SUPER_TABLE_SL_LEVEL 5 // TODO: may change here
#define TSDB_META_FILE_NAME "META"
//
#define TSDB_META_FILE_NAME "META"
const
int32_t
DEFAULT_TAG_INDEX_COLUMN
=
0
;
// skip list built based on the first column of tags
...
...
@@ -310,7 +310,7 @@ int tsdbCreateTable(TsdbRepoT *repo, STableCfg *pCfg) {
// todo refactor extract method
size_t
size
=
strnlen
(
pCfg
->
sname
,
TSDB_TABLE_NAME_LEN
);
super
->
name
=
malloc
(
size
+
VARSTR_HEADER_SIZE
);
super
->
name
=
calloc
(
1
,
size
+
VARSTR_HEADER_SIZE
+
1
);
STR_WITH_SIZE_TO_VARSTR
(
super
->
name
,
pCfg
->
sname
,
size
);
// index the first tag column
...
...
@@ -339,7 +339,7 @@ int tsdbCreateTable(TsdbRepoT *repo, STableCfg *pCfg) {
table
->
tableId
=
pCfg
->
tableId
;
size_t
size
=
strnlen
(
pCfg
->
name
,
TSDB_TABLE_NAME_LEN
);
table
->
name
=
malloc
(
size
+
VARSTR_HEADER_SIZE
);
table
->
name
=
calloc
(
1
,
size
+
VARSTR_HEADER_SIZE
+
1
);
STR_WITH_SIZE_TO_VARSTR
(
table
->
name
,
pCfg
->
name
,
size
);
table
->
lastKey
=
0
;
...
...
@@ -356,12 +356,12 @@ int tsdbCreateTable(TsdbRepoT *repo, STableCfg *pCfg) {
// Register to meta
if
(
newSuper
)
{
tsdbAddTableToMeta
(
pMeta
,
super
,
true
);
tsdbTrace
(
"vgId:%d, super table
is created! uid:%"
PRId64
,
pRepo
->
config
.
tsdbId
,
tsdbTrace
(
"vgId:%d, super table
%s is created! uid:%"
PRId64
,
pRepo
->
config
.
tsdbId
,
varDataVal
(
super
->
name
)
,
super
->
tableId
.
uid
);
}
tsdbAddTableToMeta
(
pMeta
,
table
,
true
);
tsdbTrace
(
"vgId:%d, table
is created! tid:%d, uid:%"
PRId64
,
pRepo
->
config
.
tsdbId
,
table
->
tableId
.
tid
,
table
->
tableId
.
uid
);
tsdbTrace
(
"vgId:%d, table
%s is created! tid:%d, uid:%"
PRId64
,
pRepo
->
config
.
tsdbId
,
varDataVal
(
table
->
name
)
,
table
->
tableId
.
tid
,
table
->
tableId
.
uid
);
// Write to meta file
int
bufLen
=
0
;
...
...
@@ -409,7 +409,8 @@ int tsdbDropTable(TsdbRepoT *repo, STableId tableId) {
return
-
1
;
}
tsdbTrace
(
"vgId:%d, table is dropped! tid:%d, uid:%"
PRId64
,
pRepo
->
config
.
tsdbId
,
tableId
.
tid
,
tableId
.
uid
);
tsdbTrace
(
"vgId:%d, table %s is dropped! tid:%d, uid:%"
PRId64
,
pRepo
->
config
.
tsdbId
,
varDataVal
(
pTable
->
name
),
tableId
.
tid
,
tableId
.
uid
);
if
(
tsdbRemoveTableFromMeta
(
pMeta
,
pTable
)
<
0
)
return
-
1
;
return
0
;
...
...
src/util/inc/tskiplist.h
浏览文件 @
5b3c019f
...
...
@@ -174,7 +174,7 @@ void tSkipListNewNodeInfo(SSkipList *pSkipList, int32_t *level, int32_t *headSiz
SSkipListNode
*
tSkipListPut
(
SSkipList
*
pSkipList
,
SSkipListNode
*
pNode
);
/**
* get
only *one* node of which key is equalled to pKey, even there are more than one nodes are of the same k
ey
* get
*all* nodes which key are equivalent to pK
ey
*
* @param pSkipList
* @param pKey
...
...
@@ -234,14 +234,13 @@ SSkipListNode *tSkipListIterGet(SSkipListIterator *iter);
void
*
tSkipListDestroyIter
(
SSkipListIterator
*
iter
);
/*
* remove
only one node
of the pKey value.
* If more than one node has the same value, a
ny one
will be removed
* remove
nodes
of the pKey value.
* If more than one node has the same value, a
ll
will be removed
*
* @Return
* true: one node has been removed
* false: no node has been removed
* the count of removed nodes
*/
bool
tSkipListRemove
(
SSkipList
*
pSkipList
,
SSkipListKey
key
);
uint32_t
tSkipListRemove
(
SSkipList
*
pSkipList
,
SSkipListKey
key
);
/*
* remove the specified node in parameters
...
...
src/util/src/tskiplist.c
浏览文件 @
5b3c019f
...
...
@@ -74,7 +74,47 @@ static void tSkipListDoInsert(SSkipList *pSkipList, SSkipListNode **forward, SSk
static
SSkipListNode
*
tSkipListPushBack
(
SSkipList
*
pSkipList
,
SSkipListNode
*
pNode
);
static
SSkipListNode
*
tSkipListPushFront
(
SSkipList
*
pSkipList
,
SSkipListNode
*
pNode
);
static
SSkipListIterator
*
doCreateSkipListIterator
(
SSkipList
*
pSkipList
,
int32_t
order
);
static
SSkipListNode
*
tSkipListDoGet
(
SSkipList
*
pSkipList
,
SSkipListKey
key
);
// when order is TSDB_ORDER_ASC, return the last node with key less than val
// when order is TSDB_ORDER_DESC, return the first node with key large than val
static
SSkipListNode
*
getPriorNode
(
SSkipList
*
pSkipList
,
const
char
*
val
,
int32_t
order
)
{
__compar_fn_t
comparFn
=
pSkipList
->
comparFn
;
SSkipListNode
*
pNode
=
NULL
;
if
(
order
==
TSDB_ORDER_ASC
)
{
pNode
=
pSkipList
->
pHead
;
for
(
int32_t
i
=
pSkipList
->
level
-
1
;
i
>=
0
;
--
i
)
{
SSkipListNode
*
p
=
SL_GET_FORWARD_POINTER
(
pNode
,
i
);
while
(
p
!=
pSkipList
->
pTail
)
{
char
*
key
=
SL_GET_NODE_KEY
(
pSkipList
,
p
);
if
(
comparFn
(
key
,
val
)
<
0
)
{
pNode
=
p
;
p
=
SL_GET_FORWARD_POINTER
(
p
,
i
);
}
else
{
break
;
}
}
}
}
else
{
pNode
=
pSkipList
->
pTail
;
for
(
int32_t
i
=
pSkipList
->
level
-
1
;
i
>=
0
;
--
i
)
{
SSkipListNode
*
p
=
SL_GET_BACKWARD_POINTER
(
pNode
,
i
);
while
(
p
!=
pSkipList
->
pHead
)
{
char
*
key
=
SL_GET_NODE_KEY
(
pSkipList
,
p
);
if
(
comparFn
(
key
,
val
)
>
0
)
{
pNode
=
p
;
p
=
SL_GET_BACKWARD_POINTER
(
p
,
i
);
}
else
{
break
;
}
}
}
}
return
pNode
;
}
static
bool
initForwardBackwardPtr
(
SSkipList
*
pSkipList
)
{
uint32_t
maxLevel
=
pSkipList
->
maxLevel
;
...
...
@@ -110,7 +150,11 @@ SSkipList *tSkipListCreate(uint8_t maxLevel, uint8_t keyType, uint8_t keyLen, ui
maxLevel
=
MAX_SKIP_LIST_LEVEL
;
}
pSkipList
->
keyInfo
=
(
SSkipListKeyInfo
){.
type
=
keyType
,
.
len
=
keyLen
,
.
dupKey
=
dupKey
,
.
freeNode
=
freeNode
};
pSkipList
->
keyInfo
.
type
=
keyType
;
pSkipList
->
keyInfo
.
len
=
keyLen
;
pSkipList
->
keyInfo
.
dupKey
=
dupKey
;
pSkipList
->
keyInfo
.
freeNode
=
freeNode
;
pSkipList
->
keyFn
=
fn
;
pSkipList
->
comparFn
=
getKeyComparFunc
(
keyType
);
pSkipList
->
maxLevel
=
maxLevel
;
...
...
@@ -240,13 +284,37 @@ SSkipListNode *tSkipListPut(SSkipList *pSkipList, SSkipListNode *pNode) {
return
pNode
;
}
SArray
*
tSkipListGet
(
SSkipList
*
pSkipList
,
SSkipListKey
key
)
{
SArray
*
sa
=
taosArrayInit
(
1
,
POINTER_BYTES
);
SSkipListNode
*
pNode
=
tSkipListDoGet
(
pSkipList
,
key
);
taosArrayPush
(
sa
,
&
pNode
);
if
(
pSkipList
->
lock
)
{
pthread_rwlock_wrlock
(
pSkipList
->
lock
);
}
SSkipListNode
*
pNode
=
getPriorNode
(
pSkipList
,
key
,
TSDB_ORDER_ASC
);
while
(
1
)
{
SSkipListNode
*
p
=
SL_GET_FORWARD_POINTER
(
pNode
,
0
);
if
(
p
==
pSkipList
->
pTail
)
{
break
;
}
if
(
pSkipList
->
comparFn
(
key
,
SL_GET_NODE_KEY
(
pSkipList
,
p
))
!=
0
)
{
break
;
}
taosArrayPush
(
sa
,
&
p
);
pNode
=
p
;
}
if
(
pSkipList
->
lock
)
{
pthread_rwlock_unlock
(
pSkipList
->
lock
);
}
return
sa
;
}
size_t
tSkipListGetSize
(
const
SSkipList
*
pSkipList
)
{
if
(
pSkipList
==
NULL
)
{
return
0
;
...
...
@@ -375,14 +443,52 @@ size_t tSkipListGetSize(const SSkipList* pSkipList) {
// return true;
//}
bool
tSkipListRemove
(
SSkipList
*
pSkipList
,
SSkipListKey
key
)
{
SSkipListNode
*
pNode
=
tSkipListDoGet
(
pSkipList
,
key
)
;
if
(
pNode
!=
NULL
)
{
tSkipListRemoveNode
(
pSkipList
,
pNode
);
return
true
;
uint32_t
tSkipListRemove
(
SSkipList
*
pSkipList
,
SSkipListKey
key
)
{
uint32_t
count
=
0
;
if
(
pSkipList
->
lock
)
{
pthread_rwlock_wrlock
(
pSkipList
->
lock
)
;
}
return
false
;
SSkipListNode
*
pNode
=
getPriorNode
(
pSkipList
,
key
,
TSDB_ORDER_ASC
);
while
(
1
)
{
SSkipListNode
*
p
=
SL_GET_FORWARD_POINTER
(
pNode
,
0
);
if
(
p
==
pSkipList
->
pTail
)
{
break
;
}
if
(
pSkipList
->
comparFn
(
key
,
SL_GET_NODE_KEY
(
pSkipList
,
p
))
!=
0
)
{
break
;
}
for
(
int32_t
j
=
p
->
level
-
1
;
j
>=
0
;
--
j
)
{
SSkipListNode
*
prev
=
SL_GET_BACKWARD_POINTER
(
p
,
j
);
SSkipListNode
*
next
=
SL_GET_FORWARD_POINTER
(
p
,
j
);
SL_GET_FORWARD_POINTER
(
prev
,
j
)
=
next
;
SL_GET_BACKWARD_POINTER
(
next
,
j
)
=
prev
;
}
if
(
pSkipList
->
keyInfo
.
freeNode
)
{
tfree
(
p
);
}
++
count
;
}
// compress the minimum level of skip list
while
(
pSkipList
->
level
>
0
)
{
if
(
SL_GET_FORWARD_POINTER
(
pSkipList
->
pHead
,
pSkipList
->
level
-
1
)
!=
NULL
)
{
break
;
}
pSkipList
->
level
--
;
}
pSkipList
->
size
-=
count
;
if
(
pSkipList
->
lock
)
{
pthread_rwlock_unlock
(
pSkipList
->
lock
);
}
return
count
;
}
void
tSkipListRemoveNode
(
SSkipList
*
pSkipList
,
SSkipListNode
*
pNode
)
{
...
...
@@ -425,54 +531,25 @@ SSkipListIterator* tSkipListCreateIter(SSkipList *pSkipList) {
}
SSkipListIterator
*
tSkipListCreateIterFromVal
(
SSkipList
*
pSkipList
,
const
char
*
val
,
int32_t
type
,
int32_t
order
)
{
if
(
pSkipList
==
NULL
)
{
return
NULL
;
}
assert
(
order
==
TSDB_ORDER_ASC
||
order
==
TSDB_ORDER_DESC
);
assert
(
pSkipList
!=
NULL
);
SSkipListIterator
*
iter
=
doCreateSkipListIterator
(
pSkipList
,
order
);
if
(
val
==
NULL
)
{
return
doCreateSkipListIterator
(
pSkipList
,
order
);
}
else
{
SSkipListNode
*
forward
[
MAX_SKIP_LIST_LEVEL
]
=
{
0
};
int32_t
ret
=
-
1
;
__compar_fn_t
filterComparFn
=
getKeyComparFunc
(
pSkipList
->
keyInfo
.
type
);
SSkipListNode
*
pNode
=
pSkipList
->
pHead
;
for
(
int32_t
i
=
pSkipList
->
level
-
1
;
i
>=
0
;
--
i
)
{
SSkipListNode
*
p
=
SL_GET_FORWARD_POINTER
(
pNode
,
i
);
while
(
p
!=
pSkipList
->
pTail
)
{
char
*
key
=
SL_GET_NODE_KEY
(
pSkipList
,
p
);
if
((
ret
=
filterComparFn
(
key
,
val
))
<
0
)
{
pNode
=
p
;
p
=
SL_GET_FORWARD_POINTER
(
p
,
i
);
}
else
{
break
;
}
}
forward
[
i
]
=
pNode
;
}
SSkipListIterator
*
iter
=
doCreateSkipListIterator
(
pSkipList
,
order
);
// set the initial position
if
(
order
==
TSDB_ORDER_ASC
)
{
iter
->
cur
=
forward
[
0
];
// greater equals than the value
}
else
{
iter
->
cur
=
SL_GET_FORWARD_POINTER
(
forward
[
0
],
0
);
if
(
ret
==
0
)
{
assert
(
iter
->
cur
!=
pSkipList
->
pTail
);
iter
->
cur
=
SL_GET_FORWARD_POINTER
(
iter
->
cur
,
0
);
}
}
return
iter
;
}
if
(
pSkipList
->
lock
)
{
pthread_rwlock_rdlock
(
pSkipList
->
lock
);
}
iter
->
cur
=
getPriorNode
(
pSkipList
,
val
,
order
);
if
(
pSkipList
->
lock
)
{
pthread_rwlock_unlock
(
pSkipList
->
lock
);
}
return
iter
;
}
bool
tSkipListIterNext
(
SSkipListIterator
*
iter
)
{
...
...
@@ -487,17 +564,9 @@ bool tSkipListIterNext(SSkipListIterator *iter) {
}
if
(
iter
->
order
==
TSDB_ORDER_ASC
)
{
// ascending order iterate
if
(
iter
->
cur
==
NULL
)
{
iter
->
cur
=
SL_GET_FORWARD_POINTER
(
pSkipList
->
pHead
,
0
);
}
else
{
iter
->
cur
=
SL_GET_FORWARD_POINTER
(
iter
->
cur
,
0
);
}
iter
->
cur
=
SL_GET_FORWARD_POINTER
(
iter
->
cur
,
0
);
}
else
{
// descending order iterate
if
(
iter
->
cur
==
NULL
)
{
iter
->
cur
=
SL_GET_BACKWARD_POINTER
(
pSkipList
->
pTail
,
0
);
}
else
{
iter
->
cur
=
SL_GET_BACKWARD_POINTER
(
iter
->
cur
,
0
);
}
iter
->
cur
=
SL_GET_BACKWARD_POINTER
(
iter
->
cur
,
0
);
}
if
(
pSkipList
->
lock
)
{
...
...
@@ -638,57 +707,16 @@ SSkipListNode* tSkipListPushBack(SSkipList *pSkipList, SSkipListNode *pNode) {
return
pNode
;
}
SSkipListNode
*
tSkipListDoGet
(
SSkipList
*
pSkipList
,
SSkipListKey
skey
)
{
SSkipListNode
*
pNode
=
pSkipList
->
pHead
;
SSkipListNode
*
pRes
=
NULL
;
if
(
pSkipList
->
lock
)
{
pthread_rwlock_rdlock
(
pSkipList
->
lock
);
}
#if SKIP_LIST_RECORD_PERFORMANCE
pSkipList
->
state
.
queryCount
++
;
#endif
__compar_fn_t
cmparFn
=
getComparFunc
(
pSkipList
->
keyInfo
.
type
,
0
);
int32_t
ret
=
-
1
;
for
(
int32_t
i
=
pSkipList
->
level
-
1
;
i
>=
0
;
--
i
)
{
SSkipListNode
*
p
=
SL_GET_FORWARD_POINTER
(
pNode
,
i
);
while
(
p
!=
pSkipList
->
pTail
)
{
char
*
key
=
SL_GET_NODE_KEY
(
pSkipList
,
p
);
if
((
ret
=
cmparFn
(
key
,
skey
))
<
0
)
{
pNode
=
p
;
p
=
SL_GET_FORWARD_POINTER
(
p
,
i
);
}
else
{
break
;
}
}
// find the qualified key
if
(
ret
==
0
)
{
pRes
=
SL_GET_FORWARD_POINTER
(
pNode
,
i
);
break
;
// skip list does not allowed duplicated key, abort further retrieve data
// if (!pSkipList->keyInfo.dupKey) {
// break;
// }
}
}
if
(
pSkipList
->
lock
)
{
pthread_rwlock_unlock
(
pSkipList
->
lock
);
}
return
pRes
;
}
SSkipListIterator
*
doCreateSkipListIterator
(
SSkipList
*
pSkipList
,
int32_t
order
)
{
SSkipListIterator
*
iter
=
calloc
(
1
,
sizeof
(
SSkipListIterator
));
iter
->
pSkipList
=
pSkipList
;
iter
->
order
=
order
;
if
(
order
==
TSDB_ORDER_ASC
)
{
iter
->
cur
=
pSkipList
->
pHead
;
}
else
{
iter
->
cur
=
pSkipList
->
pTail
;
}
return
iter
;
}
\ No newline at end of file
src/util/tests/skiplistTest.cpp
浏览文件 @
5b3c019f
...
...
@@ -281,34 +281,55 @@ void skiplistPerformanceTest() {
// todo not support duplicated key yet
void
duplicatedKeyTest
()
{
#if 0
SSkipListKey key;
key.nType = TSDB_DATA_TYPE_INT;
SSkipListNode **pNodes = NULL;
SSkipList
*
pSkipList
=
tSkipListCreate
(
MAX_SKIP_LIST_LEVEL
,
TSDB_DATA_TYPE_INT
,
sizeof
(
int
),
true
,
false
,
true
,
getkey
);
SSkipList *pSkipList = tSkipListCreate(MAX_SKIP_LIST_LEVEL, TSDB_DATA_TYPE_INT, sizeof(int));
for (int32_t i = 0; i < 10000; ++i) {
for
(
int32_t
i
=
0
;
i
<
200
;
++
i
)
{
for
(
int32_t
j
=
0
;
j
<
5
;
++
j
)
{
key.i64Key = i;
tSkipListPut(pSkipList, "", &key, 1);
int32_t
level
,
size
;
tSkipListNewNodeInfo
(
pSkipList
,
&
level
,
&
size
);
SSkipListNode
*
d
=
(
SSkipListNode
*
)
calloc
(
1
,
size
+
sizeof
(
int32_t
));
d
->
level
=
level
;
int32_t
*
key
=
(
int32_t
*
)
SL_GET_NODE_KEY
(
pSkipList
,
d
);
key
[
0
]
=
i
;
tSkipListPut
(
pSkipList
,
d
);
}
}
tSkipListPrint(pSkipList, 1);
for
(
int32_t
i
=
0
;
i
<
100
;
++
i
)
{
key.i64Key = rand() % 1000;
int32_t size = tSkipListGets(pSkipList, &key, &pNodes);
assert(size == 5);
SSkipListKey
key
;
SArray
*
nodes
=
tSkipListGet
(
pSkipList
,
(
char
*
)(
&
i
));
assert
(
taosArrayGetSize
(
nodes
)
==
5
);
taosArrayDestroy
(
nodes
);
}
tfree(pNodes);
int32_t
key
=
101
;
uint32_t
num
=
tSkipListRemove
(
pSkipList
,
(
char
*
)(
&
key
));
assert
(
num
==
5
);
SArray
*
nodes
=
tSkipListGet
(
pSkipList
,
(
char
*
)(
&
key
));
assert
(
taosArrayGetSize
(
nodes
)
==
0
);
taosArrayDestroy
(
nodes
);
key
=
102
;
SSkipListIterator
*
iter
=
tSkipListCreateIterFromVal
(
pSkipList
,
(
char
*
)(
&
key
),
TSDB_DATA_TYPE_INT
,
TSDB_ORDER_ASC
);
for
(
int
i
=
0
;
i
<
6
;
i
++
)
{
assert
(
tSkipListIterNext
(
iter
)
==
true
);
SSkipListNode
*
node
=
tSkipListIterGet
(
iter
);
int32_t
*
val
=
(
int32_t
*
)
SL_GET_NODE_KEY
(
pSkipList
,
node
);
assert
((
i
<
5
)
==
((
*
val
)
==
key
));
}
tSkipListDestroyIter
(
iter
);
iter
=
tSkipListCreateIterFromVal
(
pSkipList
,
(
char
*
)(
&
key
),
TSDB_DATA_TYPE_INT
,
TSDB_ORDER_DESC
);
for
(
int
i
=
0
;
i
<
6
;
i
++
)
{
assert
(
tSkipListIterNext
(
iter
)
==
true
);
SSkipListNode
*
node
=
tSkipListIterGet
(
iter
);
int32_t
*
val
=
(
int32_t
*
)
SL_GET_NODE_KEY
(
pSkipList
,
node
);
assert
((
i
<
5
)
==
((
*
val
)
==
key
));
}
tSkipListDestroyIter
(
iter
);
tSkipListDestroy
(
pSkipList
);
#endif
}
}
// namespace
...
...
tests/pytest/insert/float.py
浏览文件 @
5b3c019f
...
...
@@ -43,7 +43,7 @@ class TDTestCase:
"This test failed: insert wrong data error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"insert wrong data error catched"
)
tdLog
.
info
(
"insert wrong data error catched"
)
cmd
=
'select * from tb order by ts desc'
tdLog
.
info
(
cmd
)
...
...
@@ -82,7 +82,7 @@ class TDTestCase:
insert wrong data error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"insert wrong data error catched"
)
tdLog
.
info
(
"insert wrong data error catched"
)
cmd
=
"insert into tb values (now+4a, 0)"
tdLog
.
info
(
cmd
)
...
...
@@ -103,7 +103,7 @@ class TDTestCase:
"This test failed: insert wrong data error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"insert wrong data error catched"
)
tdLog
.
info
(
"insert wrong data error catched"
)
cmd
=
"insert into tb values (now+5a, 2)"
tdLog
.
info
(
cmd
)
...
...
@@ -124,7 +124,7 @@ class TDTestCase:
"This test failed: insert wrong data error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"insert wrong data error catched"
)
tdLog
.
info
(
"insert wrong data error catched"
)
cmd
=
"insert into tb values (now+6a, 2)"
tdLog
.
info
(
cmd
)
...
...
tests/pytest/insert/int.py
浏览文件 @
5b3c019f
...
...
@@ -47,7 +47,7 @@ class TDTestCase:
"This test failed: INT data overflow error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"INT data overflow error catched"
)
tdLog
.
info
(
"INT data overflow error catched"
)
cmd
=
'insert into tb values (now+1m, NULL)'
tdLog
.
info
(
cmd
)
...
...
@@ -76,7 +76,7 @@ class TDTestCase:
"This test failed: INT data overflow error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"INT data overflow error catched"
)
tdLog
.
info
(
"INT data overflow error catched"
)
cmd
=
'insert into tb values (now+3m, NULL)'
tdLog
.
info
(
cmd
)
...
...
@@ -96,7 +96,7 @@ class TDTestCase:
"This test failed: insert wrong data error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"insert wrong data error catched"
)
tdLog
.
info
(
"insert wrong data error catched"
)
cmd
=
'insert into tb values (now+4m, 0)'
tdLog
.
info
(
cmd
)
...
...
@@ -116,7 +116,7 @@ class TDTestCase:
"This test failed: insert wrong data error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"insert wrong data error catched"
)
tdLog
.
info
(
"insert wrong data error catched"
)
cmd
=
'insert into tb values (now+5m, 2)'
tdLog
.
info
(
cmd
)
...
...
@@ -135,7 +135,7 @@ class TDTestCase:
"This test failed: insert wrong data error _not_ catched"
)
except
Exception
as
e
:
tdLog
.
info
(
repr
(
e
))
tdLog
.
notice
(
"insert wrong data error catched"
)
tdLog
.
info
(
"insert wrong data error catched"
)
cmd
=
'insert into tb values (now+6m, 2)'
tdLog
.
info
(
cmd
)
...
...
tests/pytest/smoketest.sh
浏览文件 @
5b3c019f
...
...
@@ -29,8 +29,6 @@ python3 ./test.py $1 -s && sleep 1
python3 ./test.py
$1
-f
table/db_table.py
python3 ./test.py
$1
-s
&&
sleep
1
python3 ./test.py
$1
-f
import_merge/importCacheFileT.py
python3 ./test.py
$1
-s
&&
sleep
1
python3 ./test.py
$1
-f
import_merge/importDataLastSub.py
python3 ./test.py
$1
-s
&&
sleep
1
python3 ./test.py
$1
-f
import_merge/importHead.py
...
...
tests/pytest/test.py
浏览文件 @
5b3c019f
...
...
@@ -79,7 +79,8 @@ if __name__ == "__main__":
time
.
sleep
(
1
)
processID
=
subprocess
.
check_output
(
psCmd
,
shell
=
True
)
tdLog
.
exit
(
'stop All dnodes'
)
tdLog
.
info
(
'stop All dnodes'
)
sys
.
exit
(
0
)
tdDnodes
.
init
(
deployPath
)
tdDnodes
.
setTestCluster
(
testCluster
)
...
...
tests/pytest/util/cases.py
浏览文件 @
5b3c019f
...
...
@@ -57,7 +57,7 @@ class TDCases:
runNum
+=
1
continue
tdLog
.
notice
(
"total %d Linux test case(s) executed"
%
(
runNum
))
tdLog
.
info
(
"total %d Linux test case(s) executed"
%
(
runNum
))
def
runOneLinux
(
self
,
conn
,
fileName
):
testModule
=
self
.
__dynamicLoadModule
(
fileName
)
...
...
@@ -76,8 +76,6 @@ class TDCases:
runNum
+=
1
continue
tdLog
.
success
(
"total %d Linux test case(s) executed"
%
(
runNum
))
def
runAllWindows
(
self
,
conn
):
# TODO: load all Windows cases here
runNum
=
0
...
...
tests/pytest/util/dnodes.py
浏览文件 @
5b3c019f
...
...
@@ -202,7 +202,7 @@ class TDDnode:
if
(
binPath
==
""
):
tdLog
.
exit
(
"taosd not found!s"
)
else
:
tdLog
.
notice
(
"taosd found in %s"
%
rootRealPath
)
tdLog
.
info
(
"taosd found in %s"
%
rootRealPath
)
if
self
.
deployed
==
0
:
tdLog
.
exit
(
"dnode:%d is not deployed"
%
(
self
.
index
))
...
...
@@ -408,7 +408,7 @@ class TDDnodes:
tdLog
.
exit
(
"index:%d should on a scale of [1, 10]"
%
(
index
))
def
stopAll
(
self
):
tdLog
.
debug
(
"stop all dnodes"
)
tdLog
.
info
(
"stop all dnodes"
)
for
i
in
range
(
len
(
self
.
dnodes
)):
self
.
dnodes
[
i
].
stop
()
...
...
tests/pytest/valgrind-test.sh
浏览文件 @
5b3c019f
...
...
@@ -29,7 +29,5 @@ python3 ./test.py $1 -s && sleep 1
python3 ./test.py
$1
-f
table/db_table.py
python3 ./test.py
$1
-s
&&
sleep
1
python3 ./test.py
$1
-f
import_merge/importCacheFileT.py
python3 ./test.py
$1
-s
&&
sleep
1
python3 ./test.py
$1
-f
import_merge/importDataLastSub.py
python3 ./test.py
$1
-s
&&
sleep
1
tests/script/jenkins/basic.txt
浏览文件 @
5b3c019f
...
...
@@ -150,7 +150,7 @@ cd ../../../debug; make
#./test.sh -f general/parser/bug.sim
./test.sh -f general/stable/disk.sim
#./test.sh -f general/stable/dnode3.sim
#
liao
./test.sh -f general/stable/dnode3.sim
./test.sh -f general/stable/metrics.sim
./test.sh -f general/stable/values.sim
./test.sh -f general/stable/vnode3.sim
...
...
@@ -241,34 +241,34 @@ cd ../../../debug; make
./test.sh -u -f unique/account/user_create.sim
./test.sh -u -f unique/account/user_len.sim
#./test.sh -u -f unique/big/balance.sim
#
slguan
./test.sh -u -f unique/big/maxvnodes.sim
#
liao wait
./test.sh -u -f unique/big/balance.sim
#
liao wait
./test.sh -u -f unique/big/maxvnodes.sim
./test.sh -u -f unique/big/tcp.sim
#jeff
./test.sh -u -f unique/cluster/balance1.sim
#jeff
./test.sh -u -f unique/cluster/balance2.sim
#jeff
./test.sh -u -f unique/cluster/balance3.sim
#
./test.sh -u -f unique/cluster/cache.sim
./test.sh -u -f unique/cluster/balance1.sim
./test.sh -u -f unique/cluster/balance2.sim
./test.sh -u -f unique/cluster/balance3.sim
./test.sh -u -f unique/cluster/cache.sim
./test.sh -u -f unique/column/replica3.sim
#
hongze crash
./test.sh -u -f unique/db/commit.sim
#
liao wait
./test.sh -u -f unique/db/commit.sim
./test.sh -u -f unique/db/delete.sim
./test.sh -u -f unique/db/delete_part.sim
./test.sh -u -f unique/db/replica_add12.sim
#hongze
crash
./test.sh -u -f unique/db/replica_add13.sim
#hongze
crash
./test.sh -u -f unique/db/replica_add23.sim
#hongze
crash
./test.sh -u -f unique/db/replica_reduce21.sim
#hongze ./test.sh -u -f unique/db/replica_add13.sim
#hongze
wait
./test.sh -u -f unique/db/replica_add23.sim
#hongze
wait
./test.sh -u -f unique/db/replica_reduce21.sim
./test.sh -u -f unique/db/replica_reduce32.sim
#hongze
crash
/test.sh -u -f unique/db/replica_reduce31.sim
#hongze
wait
/test.sh -u -f unique/db/replica_reduce31.sim
./test.sh -u -f unique/db/replica_part.sim
##
./test.sh -u -f unique/dnode/balance1.sim
##
./test.sh -u -f unique/dnode/balance2.sim
##
./test.sh -u -f unique/dnode/balance3.sim
##
./test.sh -u -f unique/dnode/balancex.sim
##
./test.sh -u -f unique/dnode/offline1.sim
#
#
./test.sh -u -f unique/dnode/offline2.sim
./test.sh -u -f unique/dnode/balance1.sim
./test.sh -u -f unique/dnode/balance2.sim
./test.sh -u -f unique/dnode/balance3.sim
./test.sh -u -f unique/dnode/balancex.sim
./test.sh -u -f unique/dnode/offline1.sim
#
hongze wait
./test.sh -u -f unique/dnode/offline2.sim
./test.sh -u -f unique/dnode/remove1.sim
#hongze ./test.sh -u -f unique/dnode/remove2.sim
./test.sh -u -f unique/dnode/vnode_clean.sim
...
...
@@ -276,17 +276,17 @@ cd ../../../debug; make
./test.sh -u -f unique/http/admin.sim
./test.sh -u -f unique/http/opentsdb.sim
#./test.sh -u -f unique/import/replica2.sim
#./test.sh -u -f unique/import/replica3.sim
#
liao wait
./test.sh -u -f unique/import/replica2.sim
#
liao wait
./test.sh -u -f unique/import/replica3.sim
#./test.sh -u -f unique/stable/balance_replica1.sim
#./test.sh -u -f unique/stable/dnode2_stop.sim
#./test.sh -u -f unique/stable/dnode2.sim
#./test.sh -u -f unique/stable/dnode3.sim
#./test.sh -u -f unique/stable/replica2_dnode4.sim
#./test.sh -u -f unique/stable/replica2_vnode3.sim
#./test.sh -u -f unique/stable/replica3_dnode6.sim
#./test.sh -u -f unique/stable/replica3_vnode3.sim
#
liao wait
./test.sh -u -f unique/stable/balance_replica1.sim
#
liao wait
./test.sh -u -f unique/stable/dnode2_stop.sim
#
liao wait
./test.sh -u -f unique/stable/dnode2.sim
#
liao wait
./test.sh -u -f unique/stable/dnode3.sim
#
liao wait
./test.sh -u -f unique/stable/replica2_dnode4.sim
#
liao wait
./test.sh -u -f unique/stable/replica2_vnode3.sim
#
liao wait
./test.sh -u -f unique/stable/replica3_dnode6.sim
#
liao wait
./test.sh -u -f unique/stable/replica3_vnode3.sim
./test.sh -u -f unique/mnode/mgmt22.sim
./test.sh -u -f unique/mnode/mgmt23.sim
...
...
tests/script/unique/cluster/balance1.sim
浏览文件 @
5b3c019f
...
...
@@ -77,7 +77,7 @@ print dnode2 $dnode2Vnodes
if $dnode1Vnodes != 2 then
return -1
endi
if $dnode2Vnodes !=
NULL
then
if $dnode2Vnodes !=
null
then
return -1
endi
...
...
@@ -146,7 +146,7 @@ print dnode2 $dnode2Vnodes
if $dnode1Vnodes != 3 then
goto show4
endi
if $dnode2Vnodes !=
NULL
then
if $dnode2Vnodes !=
null
then
goto show4
endi
...
...
@@ -229,7 +229,7 @@ print dnode3 $dnode3Vnodes
if $dnode1Vnodes != 3 then
goto show8
endi
if $dnode3Vnodes !=
NULL
then
if $dnode3Vnodes !=
null
then
goto show8
endi
...
...
@@ -245,7 +245,7 @@ if $dnode1Role != master then
return -1
endi
if $dnode3Role !=
NULL
then
if $dnode3Role !=
null
then
return -1
endi
...
...
tests/script/unique/cluster/balance2.sim
浏览文件 @
5b3c019f
...
...
@@ -131,7 +131,7 @@ print dnode3 $dnode3Vnodes
if $dnode1Vnodes != 3 then
goto show2
endi
if $dnode2Vnodes !=
NULL
then
if $dnode2Vnodes !=
null
then
goto show2
endi
if $dnode3Vnodes != 3 then
...
...
@@ -194,7 +194,7 @@ print dnode4 ==> $dnode4Role
if $dnode1Role != master then
return -1
endi
if $dnode2Role !=
NULL
then
if $dnode2Role !=
null
then
return -1
endi
if $dnode3Role != slave then
...
...
@@ -231,7 +231,7 @@ endi
if $dnode4Vnodes != 3 then
goto show4
endi
if $dnode3Vnodes !=
NULL
then
if $dnode3Vnodes !=
null
then
goto show4
endi
...
...
@@ -248,10 +248,10 @@ print dnode4 ==> $dnode4Role
if $dnode1Role != master then
return -1
endi
if $dnode2Role !=
NULL
then
if $dnode2Role !=
null
then
return -1
endi
if $dnode3Role !=
NULL
then
if $dnode3Role !=
null
then
return -1
endi
...
...
@@ -339,7 +339,7 @@ print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data2_5
print dnode5 $dnode5Vnodes
if $dnode1Vnodes !=
NULL
then
if $dnode1Vnodes !=
null
then
goto show6
endi
if $dnode4Vnodes != 3 then
...
...
tests/script/unique/cluster/balance3.sim
浏览文件 @
5b3c019f
...
...
@@ -110,7 +110,7 @@ endi
if $dnode3Vnodes != 3 then
goto show1
endi
if $dnode4Vnodes !=
NULL
then
if $dnode4Vnodes !=
null
then
goto show1
endi
...
...
@@ -166,7 +166,7 @@ print dnode4 $dnode4Vnodes
if $dnode1Vnodes != 3 then
goto show3
endi
if $dnode2Vnodes !=
NULL
then
if $dnode2Vnodes !=
null
then
goto show3
endi
if $dnode3Vnodes != 3 then
...
...
@@ -232,7 +232,7 @@ endi
if $dnode5Vnodes != 3 then
goto show5
endi
if $dnode3Vnodes !=
NULL
then
if $dnode3Vnodes !=
null
then
goto show5
endi
if $dnode4Vnodes != 3 then
...
...
@@ -298,7 +298,7 @@ endi
if $dnode6Vnodes != 3 then
goto show7
endi
if $dnode4Vnodes !=
NULL
then
if $dnode4Vnodes !=
null
then
goto show7
endi
...
...
tests/script/unique/cluster/cache.sim
浏览文件 @
5b3c019f
...
...
@@ -4,26 +4,18 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode2 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel
-v 0
system sh/cfg.sh -n dnode2 -c walLevel
-v 0
system sh/cfg.sh -n dnode1 -c httpMaxThreads -v 2
system sh/cfg.sh -n dnode2 -c httpMaxThreads -v 2
system sh/cfg.sh -n dnode1 -c monitor -v 1
system sh/cfg.sh -n dnode2 -c http -v 1
system sh/cfg.sh -n dnode1 -c monitor -v 2
system sh/cfg.sh -n dnode2 -c http -v 1
system sh/cfg.sh -n dnode1 -c enableHttp -v 1
system sh/cfg.sh -n dnode2 -c monitor -v 1
system sh/cfg.sh -n dnode1 -c monitorInterval -v 1
system sh/cfg.sh -n dnode2 -c monitorInterval -v 1
system sh/cfg.sh -n dnode1 -c maxVnodeConnections -v 30000
system sh/cfg.sh -n dnode2 -c maxVnodeConnections -v 30000
system sh/cfg.sh -n dnode1 -c maxMgmtConnections -v 30000
system sh/cfg.sh -n dnode2 -c maxMgmtConnections -v 30000
system sh/cfg.sh -n dnode1 -c maxMeterConnections -v 30000
system sh/cfg.sh -n dnode2 -c maxMeterConnections -v 30000
system sh/cfg.sh -n dnode1 -c maxShellConns -v 30000
system sh/cfg.sh -n dnode2 -c maxShellConns -v 30000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
...
...
@@ -45,13 +37,20 @@ sleep 3000
system sh/exec.sh -n dnode2 -s start
sql create dnode $hostname2
sleep 20000
sql select * from log.dn_192_168_0_1
sleep 10000
sql show log.tables;
if $rows != 5 then
return -1
endi
sql select * from log.dn1
print ===>rows $rows
print $data00 $data01 $data02
print $data10 $data11 $data12
print $data20 $data21 $data22
if $rows <
2
0 then
if $rows <
1
0 then
return -1
endi
...
...
tests/script/unique/db/replica_add13.sim
浏览文件 @
5b3c019f
...
...
@@ -47,10 +47,10 @@ sql create table d2.t2 (ts timestamp, i int)
sql create table d3.t3 (ts timestamp, i int)
sql create table d4.t4 (ts timestamp, i int)
sql insert into d1.t1 values(
now
, 1)
sql insert into d2.t2 values(
now
, 1)
sql insert into d3.t3 values(
now
, 1)
sql insert into d4.t4 values(
now
, 1)
sql insert into d1.t1 values(
1589529000011
, 1)
sql insert into d2.t2 values(
1589529000021
, 1)
sql insert into d3.t3 values(
1589529000031
, 1)
sql insert into d4.t4 values(
1589529000041
, 1)
sql select * from d1.t1
if $rows != 1 then
...
...
@@ -111,10 +111,10 @@ if $data2_3 != 4 then
endi
print ======== step4
sql insert into d1.t1 values(
now
, 2)
sql insert into d2.t2 values(
now
, 2)
sql insert into d3.t3 values(
now
, 2)
sql insert into d4.t4 values(
now
, 2)
sql insert into d1.t1 values(
1589529000012
, 2)
sql insert into d2.t2 values(
1589529000022
, 2)
sql insert into d3.t3 values(
1589529000032
, 2)
sql insert into d4.t4 values(
1589529000042
, 2)
sql select * from d1.t1
if $rows != 2 then
...
...
@@ -142,10 +142,10 @@ sleep 1000
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
sleep 5000
sql insert into d1.t1 values(
now
, 3)
sql insert into d2.t2 values(
now
, 3)
sql insert into d3.t3 values(
now
, 3)
sql insert into d4.t4 values(
now
, 3)
sql insert into d1.t1 values(
1589529000013
, 3)
sql insert into d2.t2 values(
1589529000023
, 3)
sql insert into d3.t3 values(
1589529000033
, 3)
sql insert into d4.t4 values(
1589529000043
, 3)
sql select * from d1.t1
if $rows != 3 then
...
...
@@ -173,27 +173,31 @@ sleep 5000
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
sleep 3000
sql insert into d1.t1 values(
now
, 4)
sql insert into d2.t2 values(
now
, 4)
sql insert into d3.t3 values(
now
, 4)
sql insert into d4.t4 values(
now
, 4)
sql insert into d1.t1 values(
1589529000014
, 4)
sql insert into d2.t2 values(
1589529000024
, 4)
sql insert into d3.t3 values(
1589529000034
, 4)
sql insert into d4.t4 values(
1589529000044
, 4)
sql select * from d1.t1
print select * from d1.t1 $rows
if $rows != 4 then
return -1
endi
sql select * from d2.t2
print select * from d2.t2 $rows
if $rows != 4 then
return -1
endi
sql select * from d3.t3
print select * from d3.t3 $rows
if $rows != 4 then
return -1
endi
sql select * from d4.t4
print select * from d4.t4 $rows
if $rows != 4 then
return -1
endi
...
...
@@ -204,10 +208,10 @@ sleep 5000
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
sleep 3000
sql insert into d1.t1 values(
now
, 5)
sql insert into d2.t2 values(
now
, 5)
sql insert into d3.t3 values(
now
, 5)
sql insert into d4.t4 values(
now
, 5)
sql insert into d1.t1 values(
1589529000015
, 5)
sql insert into d2.t2 values(
1589529000025
, 5)
sql insert into d3.t3 values(
1589529000035
, 5)
sql insert into d4.t4 values(
1589529000045
, 5)
sql select * from d1.t1
if $rows != 5 then
...
...
@@ -235,10 +239,10 @@ sleep 5000
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
sleep 3000
sql insert into d1.t1 values(
now
, 6)
sql insert into d2.t2 values(
now
, 6)
sql insert into d3.t3 values(
now
, 6)
sql insert into d4.t4 values(
now
, 6)
sql insert into d1.t1 values(
1589529000016
, 6)
sql insert into d2.t2 values(
1589529000026
, 6)
sql insert into d3.t3 values(
1589529000036
, 6)
sql insert into d4.t4 values(
1589529000046
, 6)
sql select * from d1.t1
if $rows != 6 then
...
...
tests/script/unique/dnode/balance1.sim
浏览文件 @
5b3c019f
...
...
@@ -53,7 +53,7 @@ $x = 0
show2:
$x = $x + 1
sleep 2000
if $x ==
3
0 then
if $x ==
1
0 then
return -1
endi
...
...
@@ -93,7 +93,7 @@ $x = 0
show4:
$x = $x + 1
sleep 2000
if $x ==
3
0 then
if $x ==
1
0 then
return -1
endi
...
...
@@ -103,7 +103,7 @@ print dnode2 openVnodes $data2_2
if $data2_1 != 2 then
goto show4
endi
if $data2_2 !=
NULL
then
if $data2_2 !=
null
then
goto show4
endi
if $rows != 1 then
...
...
@@ -131,7 +131,7 @@ print dnode3 openVnodes $data2_3
if $data2_1 != 0 then
goto show5
endi
if $data2_2 !=
NULL
then
if $data2_2 !=
null
then
goto show5
endi
if $data2_3 != 2 then
...
...
@@ -155,7 +155,7 @@ print dnode3 openVnodes $data2_3
if $data2_1 != 0 then
return -1
endi
if $data2_2 !=
NULL
then
if $data2_2 !=
null
then
return -1
endi
if $data2_3 != 3 then
...
...
@@ -170,7 +170,7 @@ $x = 0
show7:
$x = $x + 1
sleep 2000
if $x ==
3
0 then
if $x ==
1
0 then
return -1
endi
...
...
@@ -182,7 +182,7 @@ print dnode4 openVnodes $data2_4
if $data2_1 != 0 then
goto show7
endi
if $data2_2 !=
NULL
then
if $data2_2 !=
null
then
goto show7
endi
if $data2_3 != 2 then
...
...
@@ -210,7 +210,7 @@ print dnode4 openVnodes $data2_4
if $data2_1 != 0 then
return -1
endi
if $data2_2 !=
NULL
then
if $data2_2 !=
null
then
return -1
endi
if $data2_3 != 2 then
...
...
@@ -227,7 +227,7 @@ $x = 0
show9:
$x = $x + 1
sleep 2000
if $x ==
3
0 then
if $x ==
1
0 then
return -1
endi
...
...
@@ -240,10 +240,10 @@ print dnode4 openVnodes $data2_4
if $data2_1 != 0 then
goto show9
endi
if $data2_2 !=
NULL
then
if $data2_2 !=
null
then
goto show9
endi
if $data2_3 !=
NULL
then
if $data2_3 !=
null
then
goto show9
endi
if $data2_4 != 4 then
...
...
tests/script/unique/dnode/balance2.sim
浏览文件 @
5b3c019f
...
...
@@ -65,7 +65,7 @@ $x = 0
show2:
$x = $x + 1
sleep 2000
if $x ==
3
0 then
if $x ==
1
0 then
return -1
endi
...
...
@@ -76,7 +76,7 @@ print dnode3 openVnodes $data2_3
if $data2_1 != 2 then
goto show2
endi
if $data2_2 !=
NULL
then
if $data2_2 !=
null
then
goto show2
endi
if $data2_3 != 2 then
...
...
@@ -105,7 +105,7 @@ print dnode4 openVnodes $data2_4
if $data2_1 != 0 then
goto show3
endi
if $data2_2 !=
NULL
then
if $data2_2 !=
null
then
goto show3
endi
if $data2_3 != 2 then
...
...
@@ -132,7 +132,7 @@ print dnode4 openVnodes $data2_4
if $data2_1 != 0 then
return -1
endi
if $data2_2 !=
NULL
then
if $data2_2 !=
null
then
return -1
endi
if $data2_3 != 3 then
...
...
@@ -150,7 +150,7 @@ $x = 0
show5:
$x = $x + 1
sleep 2000
if $x ==
3
0 then
if $x ==
1
0 then
return -1
endi
...
...
@@ -163,7 +163,7 @@ print dnode5 openVnodes $data2_5
if $data2_1 != 0 then
goto show5
endi
if $data2_2 !=
NULL
then
if $data2_2 !=
null
then
goto show5
endi
if $data2_3 != 2 then
...
...
@@ -183,7 +183,7 @@ $x = 0
show6:
$x = $x + 1
sleep 2000
if $x ==
3
0 then
if $x ==
1
0 then
return -1
endi
...
...
@@ -196,10 +196,10 @@ print dnode5 openVnodes $data2_5
if $data2_1 != 0 then
goto show6
endi
if $data2_2 !=
NULL
then
if $data2_2 !=
null
then
goto show6
endi
if $data2_3 !=
NULL
then
if $data2_3 !=
null
then
goto show6
endi
if $data2_4 != 3 then
...
...
tests/script/unique/dnode/balance3.sim
浏览文件 @
5b3c019f
...
...
@@ -88,7 +88,7 @@ print dnode4 openVnodes $data2_4
if $data2_1 != 2 then
goto show2
endi
if $data2_2 !=
NULL
then
if $data2_2 !=
null
then
goto show2
endi
if $data2_3 != 2 then
...
...
@@ -122,7 +122,7 @@ print dnode5 openVnodes $data2_5
if $data2_1 != 0 then
goto show3
endi
if $data2_2 !=
NULL
then
if $data2_2 !=
null
then
goto show3
endi
if $data2_3 != 2 then
...
...
@@ -162,7 +162,7 @@ print dnode5 openVnodes $data2_5
if $data2_1 != 0 then
goto show4
endi
if $data2_2 !=
NULL
then
if $data2_2 !=
null
then
goto show4
endi
if $data2_3 != 3 then
...
...
@@ -228,7 +228,7 @@ endi
if $data2_6 != 3 then
goto show6
endi
if $data2_3 !=
NULL
then
if $data2_3 !=
null
then
goto show6
endi
if $data2_4 != 3 then
...
...
tests/script/unique/dnode/balancex.sim
浏览文件 @
5b3c019f
...
...
@@ -50,7 +50,7 @@ $x = 0
show2:
$x = $x + 1
sleep 2000
if $x ==
3
0 then
if $x ==
1
0 then
return -1
endi
...
...
@@ -77,7 +77,7 @@ $x = 0
show3:
$x = $x + 1
sleep 2000
if $x ==
3
0 then
if $x ==
1
0 then
return -1
endi
sql show dnodes
...
...
@@ -122,7 +122,7 @@ $x = 0
show5:
$x = $x + 1
sleep 2000
if $x ==
3
0 then
if $x ==
1
0 then
return -1
endi
sql show dnodes
...
...
@@ -132,7 +132,7 @@ print dnode3 openVnodes $data2_3
if $data2_1 != 1 then
goto show5
endi
if $data2_2 !=
NULL
then
if $data2_2 !=
null
then
goto show5
endi
if $data2_3 != 3 then
...
...
tests/script/unique/dnode/offline1.sim
浏览文件 @
5b3c019f
...
...
@@ -63,7 +63,7 @@ print dnode1 $data4_2
if $data4_1 != ready then
return -1
endi
if $data4_2 !=
NULL
then
if $data4_2 !=
null
then
return -1
endi
...
...
tests/script/unique/dnode/offline2.sim
浏览文件 @
5b3c019f
...
...
@@ -82,15 +82,18 @@ $x = 0
show4:
$x = $x + 1
sleep 5000
if $x ==
5
0 then
if $x ==
1
0 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
if $data4_1 != ready then
goto show4
endi
if $data4_2 !=
NULL
then
if $data4_2 !=
null
then
goto show4
endi
if $data4_3 != ready then
...
...
tests/script/unique/stable/dnode3.sim
浏览文件 @
5b3c019f
...
...
@@ -77,11 +77,11 @@ if $rows != 3 then
endi
sql show dnodes
$dnode1Vnodes = $data
3_192.168.0.
1
$dnode1Vnodes = $data
2_
1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data
3_192.168.0.
2
$dnode2Vnodes = $data
2_
2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data
3_192.168.0.
3
$dnode3Vnodes = $data
2_
3
print dnode3 $dnode3Vnodes
if $dnode1Vnodes != 3 then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录