Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
fb518983
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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,发现更多精彩内容 >>
提交
fb518983
编写于
5月 30, 2020
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into feature/2.0tsdb
上级
cf1acba4
f17bc158
变更
83
隐藏空白更改
内联
并排
Showing
83 changed file
with
730 addition
and
356 deletion
+730
-356
importSampleData/app/main.go
importSampleData/app/main.go
+3
-1
importSampleData/bin/taosimport
importSampleData/bin/taosimport
+0
-0
src/client/src/tscServer.c
src/client/src/tscServer.c
+2
-3
src/client/src/tscSql.c
src/client/src/tscSql.c
+4
-1
src/client/src/tscSystem.c
src/client/src/tscSystem.c
+4
-4
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+2
-4
src/common/src/tglobal.c
src/common/src/tglobal.c
+10
-32
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+4
-2
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+39
-1
src/dnode/src/dnodeSystem.c
src/dnode/src/dnodeSystem.c
+6
-2
src/dnode/src/dnodeVWrite.c
src/dnode/src/dnodeVWrite.c
+4
-1
src/inc/dnode.h
src/inc/dnode.h
+4
-3
src/inc/taosdef.h
src/inc/taosdef.h
+0
-3
src/inc/taoserror.h
src/inc/taoserror.h
+10
-12
src/inc/taosmsg.h
src/inc/taosmsg.h
+3
-3
src/kit/shell/src/shellDarwin.c
src/kit/shell/src/shellDarwin.c
+6
-2
src/kit/shell/src/shellLinux.c
src/kit/shell/src/shellLinux.c
+5
-0
src/kit/shell/src/shellWindows.c
src/kit/shell/src/shellWindows.c
+6
-2
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+151
-27
src/mnode/src/mnodeMain.c
src/mnode/src/mnodeMain.c
+2
-2
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+5
-5
src/mnode/src/mnodeShow.c
src/mnode/src/mnodeShow.c
+9
-7
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+18
-29
src/plugins/http/src/tgHandle.c
src/plugins/http/src/tgHandle.c
+1
-1
src/util/src/tconfig.c
src/util/src/tconfig.c
+6
-1
src/util/src/tqueue.c
src/util/src/tqueue.c
+13
-10
tests/pytest/random-test/random-test-multi-threading.py
tests/pytest/random-test/random-test-multi-threading.py
+215
-0
tests/pytest/util/dnodes.py
tests/pytest/util/dnodes.py
+1
-1
tests/script/general/alter/count.sim
tests/script/general/alter/count.sim
+1
-1
tests/script/general/alter/import.sim
tests/script/general/alter/import.sim
+1
-1
tests/script/general/db/backup/keep.sim
tests/script/general/db/backup/keep.sim
+3
-3
tests/script/general/db/delete_reuse1.sim
tests/script/general/db/delete_reuse1.sim
+4
-4
tests/script/general/db/delete_reuse2.sim
tests/script/general/db/delete_reuse2.sim
+4
-4
tests/script/general/db/delete_writing1.sim
tests/script/general/db/delete_writing1.sim
+4
-4
tests/script/general/import/basic.sim
tests/script/general/import/basic.sim
+4
-4
tests/script/general/import/commit.sim
tests/script/general/import/commit.sim
+4
-4
tests/script/general/import/large.sim
tests/script/general/import/large.sim
+4
-4
tests/script/general/import/replica1.sim
tests/script/general/import/replica1.sim
+4
-4
tests/script/general/table/delete_reuse1.sim
tests/script/general/table/delete_reuse1.sim
+4
-4
tests/script/general/table/delete_reuse2.sim
tests/script/general/table/delete_reuse2.sim
+4
-4
tests/script/general/table/delete_writing.sim
tests/script/general/table/delete_writing.sim
+4
-4
tests/script/sh/clear.sh
tests/script/sh/clear.sh
+1
-1
tests/script/sh/deploy.sh
tests/script/sh/deploy.sh
+1
-1
tests/script/tmp/mnodes.sim
tests/script/tmp/mnodes.sim
+3
-3
tests/script/tmp/prepare.sim
tests/script/tmp/prepare.sim
+4
-4
tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim
...t/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim
+5
-5
tests/script/unique/arbitrator/replica_changeWithArbitrator.sim
...script/unique/arbitrator/replica_changeWithArbitrator.sim
+3
-3
tests/script/unique/cluster/balance1.sim
tests/script/unique/cluster/balance1.sim
+8
-8
tests/script/unique/cluster/balance2.sim
tests/script/unique/cluster/balance2.sim
+8
-8
tests/script/unique/cluster/balance3.sim
tests/script/unique/cluster/balance3.sim
+8
-8
tests/script/unique/column/replica3.sim
tests/script/unique/column/replica3.sim
+3
-3
tests/script/unique/db/commit.sim
tests/script/unique/db/commit.sim
+3
-3
tests/script/unique/db/delete.sim
tests/script/unique/db/delete.sim
+3
-3
tests/script/unique/db/delete_part.sim
tests/script/unique/db/delete_part.sim
+4
-4
tests/script/unique/db/replica_add12.sim
tests/script/unique/db/replica_add12.sim
+4
-4
tests/script/unique/db/replica_add13.sim
tests/script/unique/db/replica_add13.sim
+4
-4
tests/script/unique/db/replica_add23.sim
tests/script/unique/db/replica_add23.sim
+4
-4
tests/script/unique/db/replica_part.sim
tests/script/unique/db/replica_part.sim
+3
-3
tests/script/unique/db/replica_reduce21.sim
tests/script/unique/db/replica_reduce21.sim
+3
-3
tests/script/unique/db/replica_reduce31.sim
tests/script/unique/db/replica_reduce31.sim
+3
-3
tests/script/unique/db/replica_reduce32.sim
tests/script/unique/db/replica_reduce32.sim
+3
-3
tests/script/unique/dnode/alternativeRole.sim
tests/script/unique/dnode/alternativeRole.sim
+3
-3
tests/script/unique/import/replica2.sim
tests/script/unique/import/replica2.sim
+4
-4
tests/script/unique/import/replica3.sim
tests/script/unique/import/replica3.sim
+4
-4
tests/script/unique/mnode/mgmt22.sim
tests/script/unique/mnode/mgmt22.sim
+3
-3
tests/script/unique/mnode/mgmt23.sim
tests/script/unique/mnode/mgmt23.sim
+4
-4
tests/script/unique/mnode/mgmt24.sim
tests/script/unique/mnode/mgmt24.sim
+3
-3
tests/script/unique/mnode/mgmt25.sim
tests/script/unique/mnode/mgmt25.sim
+3
-3
tests/script/unique/mnode/mgmt26.sim
tests/script/unique/mnode/mgmt26.sim
+4
-4
tests/script/unique/mnode/mgmt33.sim
tests/script/unique/mnode/mgmt33.sim
+4
-4
tests/script/unique/mnode/mgmt34.sim
tests/script/unique/mnode/mgmt34.sim
+5
-5
tests/script/unique/mnode/mgmtr2.sim
tests/script/unique/mnode/mgmtr2.sim
+3
-3
tests/script/unique/stream/metrics_balance.sim
tests/script/unique/stream/metrics_balance.sim
+2
-2
tests/script/unique/stream/metrics_vnode_stop.sim
tests/script/unique/stream/metrics_vnode_stop.sim
+2
-2
tests/script/unique/stream/table_balance.sim
tests/script/unique/stream/table_balance.sim
+2
-2
tests/script/unique/stream/table_move.sim
tests/script/unique/stream/table_move.sim
+4
-4
tests/script/unique/stream/table_vnode_stop.sim
tests/script/unique/stream/table_vnode_stop.sim
+2
-2
tests/script/unique/vnode/many.sim
tests/script/unique/vnode/many.sim
+4
-4
tests/script/unique/vnode/replica2_basic2.sim
tests/script/unique/vnode/replica2_basic2.sim
+4
-4
tests/script/unique/vnode/replica2_repeat.sim
tests/script/unique/vnode/replica2_repeat.sim
+4
-4
tests/script/unique/vnode/replica3_basic.sim
tests/script/unique/vnode/replica3_basic.sim
+3
-3
tests/script/unique/vnode/replica3_repeat.sim
tests/script/unique/vnode/replica3_repeat.sim
+4
-4
tests/script/unique/vnode/replica3_vgroup.sim
tests/script/unique/vnode/replica3_vgroup.sim
+3
-3
未找到文件。
importSampleData/app/main.go
浏览文件 @
fb518983
...
...
@@ -18,7 +18,7 @@ import (
"sync"
"time"
_
"github.com/taosdata/TDengine/src/connector/go/
src/
taosSql"
_
"github.com/taosdata/TDengine/src/connector/go/taosSql"
)
const
(
...
...
@@ -634,6 +634,7 @@ func insertData(threadIndex, start, end int, wg *sync.WaitGroup, successRows []
if
appendRows
==
batch
{
// executebatch
insertSql
:=
buffers
.
String
()
connection
.
Exec
(
"use "
+
db
)
affectedRows
:=
executeBatchInsert
(
insertSql
,
connection
)
successRows
[
threadIndex
]
+=
affectedRows
...
...
@@ -658,6 +659,7 @@ func insertData(threadIndex, start, end int, wg *sync.WaitGroup, successRows []
if
appendRows
>
0
{
// executebatch
insertSql
:=
buffers
.
String
()
connection
.
Exec
(
"use "
+
db
)
affectedRows
:=
executeBatchInsert
(
insertSql
,
connection
)
successRows
[
threadIndex
]
+=
affectedRows
...
...
importSampleData/bin/taosimport
浏览文件 @
fb518983
无法预览此类型文件
src/client/src/tscServer.c
浏览文件 @
fb518983
...
...
@@ -238,9 +238,8 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcIpSet *pIpSet) {
}
else
{
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
if
(
rpcMsg
->
code
==
TSDB_CODE_NOT_ACTIVE_TABLE
||
rpcMsg
->
code
==
TSDB_CODE_INVALID_TABLE_ID
||
rpcMsg
->
code
==
TSDB_CODE_INVALID_VNODE_ID
||
rpcMsg
->
code
==
TSDB_CODE_NOT_ACTIVE_VNODE
||
rpcMsg
->
code
==
TSDB_CODE_NETWORK_UNAVAIL
||
rpcMsg
->
code
==
TSDB_CODE_NOT_ACTIVE_TABLE
||
rpcMsg
->
code
==
TSDB_CODE_TABLE_ID_MISMATCH
)
{
rpcMsg
->
code
==
TSDB_CODE_INVALID_VGROUP_ID
||
rpcMsg
->
code
==
TSDB_CODE_NOT_ACTIVE_VNODE
||
rpcMsg
->
code
==
TSDB_CODE_NETWORK_UNAVAIL
||
rpcMsg
->
code
==
TSDB_CODE_TABLE_ID_MISMATCH
)
{
/*
* not_active_table: 1. the virtual node may fail to create table, since the procedure of create table is asynchronized,
* the virtual node may have not create table till now, so try again by using the new metermeta.
...
...
src/client/src/tscSql.c
浏览文件 @
fb518983
...
...
@@ -591,7 +591,10 @@ void taos_free_result_imp(TAOS_RES *res, int keepCmd) {
tscProcessSql
(
pSql
);
// waits for response and then goes on
sem_wait
(
&
pSql
->
rspSem
);
STscObj
*
pTscObj
=
pSql
->
pTscObj
;
if
(
pTscObj
->
pSql
==
pSql
)
{
sem_wait
(
&
pSql
->
rspSem
);
}
}
else
{
// if no free resource msg is sent to vnode, we free this object immediately.
STscObj
*
pTscObj
=
pSql
->
pTscObj
;
...
...
src/client/src/tscSystem.c
浏览文件 @
fb518983
...
...
@@ -57,9 +57,9 @@ int32_t tscInitRpc(const char *user, const char *secret, void** pDnodeConn) {
memset
(
&
rpcInit
,
0
,
sizeof
(
rpcInit
));
rpcInit
.
localPort
=
0
;
rpcInit
.
label
=
"TSC"
;
rpcInit
.
numOfThreads
=
tscNumOfThreads
;
rpcInit
.
numOfThreads
=
1
;
// every DB connection has only one thread
rpcInit
.
cfp
=
tscProcessMsgFromServer
;
rpcInit
.
sessions
=
tsMax
Vnode
Connections
;
rpcInit
.
sessions
=
tsMaxConnections
;
rpcInit
.
connType
=
TAOS_CONN_CLIENT
;
rpcInit
.
user
=
(
char
*
)
user
;
rpcInit
.
idleTime
=
2000
;
...
...
@@ -121,7 +121,7 @@ void taos_init_imp() {
}
tscInitMsgsFp
();
int
queueSize
=
tsMax
VnodeConnections
+
tsMaxMeterConnections
+
tsMaxMgmtConnections
+
tsMaxMgmtConnections
;
int
queueSize
=
tsMax
Connections
*
2
;
if
(
tscEmbedded
==
0
)
{
tscNumOfThreads
=
tsNumOfCores
*
tsNumOfThreadsPerCore
/
2
.
0
;
...
...
@@ -137,7 +137,7 @@ void taos_init_imp() {
return
;
}
tscTmr
=
taosTmrInit
(
tsMax
Mgmt
Connections
*
2
,
200
,
60000
,
"TSC"
);
tscTmr
=
taosTmrInit
(
tsMaxConnections
*
2
,
200
,
60000
,
"TSC"
);
if
(
0
==
tscEmbedded
){
taosTmrReset
(
tscCheckDiskUsage
,
10
,
NULL
,
tscTmr
,
&
tscCheckDiskUsageTmr
);
}
...
...
src/common/inc/tglobal.h
浏览文件 @
fb518983
...
...
@@ -87,16 +87,14 @@ extern int16_t tsWAL;
extern
int32_t
tsReplications
;
extern
int16_t
tsAffectedRowsMod
;
extern
int32_t
tsNumOfM
Peer
s
;
extern
int32_t
tsNumOfM
node
s
;
extern
int32_t
tsMaxShellConns
;
extern
int32_t
tsMaxTables
;
extern
char
tsDefaultDB
[];
extern
char
tsDefaultUser
[];
extern
char
tsDefaultPass
[];
extern
int32_t
tsMaxMeterConnections
;
extern
int32_t
tsMaxVnodeConnections
;
extern
int32_t
tsMaxMgmtConnections
;
extern
int32_t
tsMaxConnections
;
extern
int32_t
tsBalanceInterval
;
extern
int32_t
tsOfflineThreshold
;
...
...
src/common/src/tglobal.c
浏览文件 @
fb518983
...
...
@@ -105,15 +105,13 @@ int32_t tsReplications = TSDB_DEFAULT_REPLICA_NUM;
* 1: affected rows include those duplicate records
*/
int16_t
tsAffectedRowsMod
=
0
;
int32_t
tsNumOfM
Peer
s
=
3
;
int32_t
tsMaxShellConns
=
2
000
;
int32_t
tsNumOfM
node
s
=
3
;
int32_t
tsMaxShellConns
=
5
000
;
char
tsDefaultDB
[
TSDB_DB_NAME_LEN
]
=
{
0
};
char
tsDefaultUser
[
64
]
=
"root"
;
char
tsDefaultPass
[
64
]
=
"taosdata"
;
int32_t
tsMaxMeterConnections
=
10000
;
int32_t
tsMaxMgmtConnections
=
2000
;
int32_t
tsMaxVnodeConnections
=
10000
;
int32_t
tsMaxConnections
=
50
;
int32_t
tsBalanceInterval
=
300
;
// seconds
int32_t
tsOfflineThreshold
=
86400
*
100
;
// seconds 10days
...
...
@@ -407,8 +405,8 @@ static void doInitGlobalConfig() {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"numOfM
Peer
s"
;
cfg
.
ptr
=
&
tsNumOfM
Peer
s
;
cfg
.
option
=
"numOfM
node
s"
;
cfg
.
ptr
=
&
tsNumOfM
node
s
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
1
;
...
...
@@ -680,7 +678,7 @@ static void doInitGlobalConfig() {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"wal
l
evel"
;
cfg
.
option
=
"wal
L
evel"
;
cfg
.
ptr
=
&
tsWAL
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT16
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
...
...
@@ -814,32 +812,12 @@ static void doInitGlobalConfig() {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"max
Meter
Connections"
;
cfg
.
ptr
=
&
tsMax
Meter
Connections
;
cfg
.
option
=
"maxConnections"
;
cfg
.
ptr
=
&
tsMaxConnections
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
10
;
cfg
.
maxValue
=
50000000
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"maxMgmtConnections"
;
cfg
.
ptr
=
&
tsMaxMgmtConnections
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
10
;
cfg
.
maxValue
=
50000000
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"maxVnodeConnections"
;
cfg
.
ptr
=
&
tsMaxVnodeConnections
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
10
;
cfg
.
maxValue
=
50000000
;
cfg
.
minValue
=
1
;
cfg
.
maxValue
=
100
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
...
...
src/dnode/src/dnodeMgmt.c
浏览文件 @
fb518983
...
...
@@ -369,7 +369,8 @@ static void dnodeUpdateMnodeInfos(SDMMnodeInfos *pMnodes) {
}
static
bool
dnodeReadMnodeInfos
()
{
char
ipFile
[
TSDB_FILENAME_LEN
]
=
{
0
};
char
ipFile
[
TSDB_FILENAME_LEN
*
2
]
=
{
0
};
sprintf
(
ipFile
,
"%s/mnodeIpList.json"
,
tsDnodeDir
);
FILE
*
fp
=
fopen
(
ipFile
,
"r"
);
if
(
!
fp
)
{
...
...
@@ -537,7 +538,8 @@ static void dnodeSendStatusMsg(void *handle, void *tmrId) {
}
static
bool
dnodeReadDnodeCfg
()
{
char
dnodeCfgFile
[
TSDB_FILENAME_LEN
]
=
{
0
};
char
dnodeCfgFile
[
TSDB_FILENAME_LEN
*
2
]
=
{
0
};
sprintf
(
dnodeCfgFile
,
"%s/dnodeCfg.json"
,
tsDnodeDir
);
FILE
*
fp
=
fopen
(
dnodeCfgFile
,
"r"
);
...
...
src/dnode/src/dnodeShell.c
浏览文件 @
fb518983
...
...
@@ -84,7 +84,7 @@ int32_t dnodeInitShell() {
rpcInit
.
label
=
"SHELL"
;
rpcInit
.
numOfThreads
=
numOfThreads
;
rpcInit
.
cfp
=
dnodeProcessMsgFromShell
;
rpcInit
.
sessions
=
TSDB_SESSIONS_PER_DNODE
;
rpcInit
.
sessions
=
tsMaxShellConns
;
rpcInit
.
connType
=
TAOS_CONN_SERVER
;
rpcInit
.
idleTime
=
tsShellActivityTimer
*
1000
;
rpcInit
.
afp
=
dnodeRetrieveUserAuthInfo
;
...
...
@@ -168,6 +168,44 @@ static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char
return
rpcRsp
.
code
;
}
void
*
dnodeSendCfgTableToRecv
(
int32_t
vgId
,
int32_t
sid
)
{
dTrace
(
"vgId:%d, sid:%d send config table msg to mnode"
,
vgId
,
sid
);
int32_t
contLen
=
sizeof
(
SDMConfigTableMsg
);
SDMConfigTableMsg
*
pMsg
=
rpcMallocCont
(
contLen
);
pMsg
->
dnodeId
=
htonl
(
dnodeGetDnodeId
());
pMsg
->
vgId
=
htonl
(
vgId
);
pMsg
->
sid
=
htonl
(
sid
);
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pMsg
;
rpcMsg
.
contLen
=
contLen
;
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_DM_CONFIG_TABLE
;
SRpcMsg
rpcRsp
=
{
0
};
dnodeSendMsgToDnodeRecv
(
&
rpcMsg
,
&
rpcRsp
);
terrno
=
rpcRsp
.
code
;
if
(
rpcRsp
.
code
!=
0
)
{
rpcFreeCont
(
rpcRsp
.
pCont
);
dError
(
"vgId:%d, sid:%d failed to config table from mnode"
,
vgId
,
sid
);
return
NULL
;
}
else
{
dPrint
(
"vgId:%d, sid:%d config table msg is received"
,
vgId
,
sid
);
// delete this after debug finished
SMDCreateTableMsg
*
pTable
=
rpcRsp
.
pCont
;
int16_t
numOfColumns
=
htons
(
pTable
->
numOfColumns
);
int16_t
numOfTags
=
htons
(
pTable
->
numOfTags
);
int32_t
sid
=
htonl
(
pTable
->
sid
);
uint64_t
uid
=
htobe64
(
pTable
->
uid
);
dPrint
(
"table:%s, numOfColumns:%d numOfTags:%d sid:%d uid:%d"
,
pTable
->
tableId
,
numOfColumns
,
numOfTags
,
sid
,
uid
);
return
rpcRsp
.
pCont
;
}
}
SDnodeStatisInfo
dnodeGetStatisInfo
()
{
SDnodeStatisInfo
info
=
{
0
};
if
(
dnodeGetRunStatus
()
==
TSDB_DNODE_RUN_STATUS_RUNING
)
{
...
...
src/dnode/src/dnodeSystem.c
浏览文件 @
fb518983
...
...
@@ -28,8 +28,12 @@ int32_t main(int32_t argc, char *argv[]) {
// Set global configuration file
for
(
int32_t
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
strcmp
(
argv
[
i
],
"-c"
)
==
0
)
{
if
(
i
<
argc
-
1
)
{
strcpy
(
configDir
,
argv
[
++
i
]);
if
(
i
<
argc
-
1
)
{
if
(
strlen
(
argv
[
++
i
])
>
TSDB_FILENAME_LEN
-
1
)
{
printf
(
"config file path overflow"
);
exit
(
EXIT_FAILURE
);
}
strcpy
(
configDir
,
argv
[
i
]);
}
else
{
printf
(
"'-c' requires a parameter, default:%s
\n
"
,
configDir
);
exit
(
EXIT_FAILURE
);
...
...
src/dnode/src/dnodeVWrite.c
浏览文件 @
fb518983
...
...
@@ -129,7 +129,10 @@ void *dnodeAllocateVnodeWqueue(void *pVnode) {
if
(
pWorker
->
qset
==
NULL
)
{
pWorker
->
qset
=
taosOpenQset
();
if
(
pWorker
->
qset
==
NULL
)
return
NULL
;
if
(
pWorker
->
qset
==
NULL
)
{
taosCloseQueue
(
queue
);
return
NULL
;
}
taosAddIntoQset
(
pWorker
->
qset
,
queue
,
pVnode
);
pWorker
->
qall
=
taosAllocateQall
();
...
...
src/inc/dnode.h
浏览文件 @
fb518983
...
...
@@ -44,9 +44,10 @@ void dnodeGetMnodeIpSetForShell(void *ipSet);
void
*
dnodeGetMnodeInfos
();
int32_t
dnodeGetDnodeId
();
void
dnodeAddClientRspHandle
(
uint8_t
msgType
,
void
(
*
fp
)(
SRpcMsg
*
rpcMsg
));
void
dnodeSendMsgToDnode
(
SRpcIpSet
*
ipSet
,
SRpcMsg
*
rpcMsg
);
void
dnodeSendMsgToDnodeRecv
(
SRpcMsg
*
rpcMsg
,
SRpcMsg
*
rpcRsp
);
void
dnodeAddClientRspHandle
(
uint8_t
msgType
,
void
(
*
fp
)(
SRpcMsg
*
rpcMsg
));
void
dnodeSendMsgToDnode
(
SRpcIpSet
*
ipSet
,
SRpcMsg
*
rpcMsg
);
void
dnodeSendMsgToDnodeRecv
(
SRpcMsg
*
rpcMsg
,
SRpcMsg
*
rpcRsp
);
void
*
dnodeSendCfgTableToRecv
(
int32_t
vgId
,
int32_t
sid
);
void
*
dnodeAllocateVnodeWqueue
(
void
*
pVnode
);
void
dnodeFreeVnodeWqueue
(
void
*
queue
);
...
...
src/inc/taosdef.h
浏览文件 @
fb518983
...
...
@@ -338,9 +338,6 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size);
#define TSDB_ORDER_ASC 1
#define TSDB_ORDER_DESC 2
#define TSDB_SESSIONS_PER_VNODE (300)
#define TSDB_SESSIONS_PER_DNODE (TSDB_SESSIONS_PER_VNODE * TSDB_MAX_VNODES)
#define TSDB_DEFAULT_MNODES_HASH_SIZE 5
#define TSDB_DEFAULT_DNODES_HASH_SIZE 10
#define TSDB_DEFAULT_ACCOUNTS_HASH_SIZE 10
...
...
src/inc/taoserror.h
浏览文件 @
fb518983
...
...
@@ -72,9 +72,8 @@ TAOS_DEFINE_ERROR(TSDB_CODE_NO_RESOURCE, 0, 0x0018, "no resource"
TAOS_DEFINE_ERROR
(
TSDB_CODE_OPS_NOT_SUPPORT
,
0
,
0x0019
,
"operations not support"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_OPTION
,
0
,
0x001A
,
"invalid option"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NOT_CONFIGURED
,
0
,
0x001B
,
"not configured"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NODE_OFFLINE
,
0
,
0x001C
,
"node offline"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NETWORK_UNAVAIL
,
0
,
0x001D
,
"network unavailable"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_AUTH_REQUIRED
,
0
,
0x001E
,
"auth required"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NETWORK_UNAVAIL
,
0
,
0x001C
,
"network unavailable"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_AUTH_REQUIRED
,
0
,
0x001D
,
"auth required"
)
// db
TAOS_DEFINE_ERROR
(
TSDB_CODE_DB_NOT_SELECTED
,
0
,
0x0100
,
"db not selected"
)
...
...
@@ -148,15 +147,14 @@ TAOS_DEFINE_ERROR(TSDB_CODE_GRANT_CPU_LIMITED, 0, 0x038F, "grant cpu li
// server
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_VGROUP_ID
,
0
,
0x0400
,
"invalid vgroup id"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_VNODE_ID
,
0
,
0x0401
,
"invalid vnode id"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NOT_ACTIVE_VNODE
,
0
,
0x0402
,
"not active vnode"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VG_INIT_FAILED
,
0
,
0x0403
,
"vg init failed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SERV_NO_DISKSPACE
,
0
,
0x0404
,
"server no diskspace"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SERV_OUT_OF_MEMORY
,
0
,
0x0405
,
"server out of memory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_DISK_PERMISSIONS
,
0
,
0x0406
,
"no disk permissions"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_FILE_CORRUPTED
,
0
,
0x0407
,
"file corrupted"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MEMORY_CORRUPTED
,
0
,
0x0408
,
"memory corrupted"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NOT_SUCH_FILE_OR_DIR
,
0
,
0x0409
,
"no such file or directory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NOT_ACTIVE_VNODE
,
0
,
0x0401
,
"not active vnode"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_VG_INIT_FAILED
,
0
,
0x0402
,
"vgroup init failed"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SERV_NO_DISKSPACE
,
0
,
0x0403
,
"server no diskspace"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_SERV_OUT_OF_MEMORY
,
0
,
0x0404
,
"server out of memory"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NO_DISK_PERMISSIONS
,
0
,
0x0405
,
"no disk permissions"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_FILE_CORRUPTED
,
0
,
0x0406
,
"file corrupted"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_MEMORY_CORRUPTED
,
0
,
0x0407
,
"memory corrupted"
)
TAOS_DEFINE_ERROR
(
TSDB_CODE_NOT_SUCH_FILE_OR_DIR
,
0
,
0x0408
,
"no such file or directory"
)
// client
TAOS_DEFINE_ERROR
(
TSDB_CODE_INVALID_CLIENT_VERSION
,
0
,
0x0481
,
"invalid client version"
)
...
...
src/inc/taosmsg.h
浏览文件 @
fb518983
...
...
@@ -676,9 +676,9 @@ typedef struct {
}
SCMCreateDnodeMsg
,
SCMDropDnodeMsg
;
typedef
struct
{
uint32_t
dnode
;
int32_t
vnode
;
int32_t
sid
;
int32_t
dnodeId
;
int32_t
vgId
;
int32_t
sid
;
}
SDMConfigTableMsg
;
typedef
struct
{
...
...
src/kit/shell/src/shellDarwin.c
浏览文件 @
fb518983
...
...
@@ -96,8 +96,12 @@ void shellParseArgument(int argc, char *argv[], struct arguments *arguments) {
exit
(
EXIT_FAILURE
);
}
}
else
if
(
strcmp
(
argv
[
i
],
"-c"
)
==
0
)
{
if
(
i
<
argc
-
1
)
{
strcpy
(
configDir
,
argv
[
++
i
]);
if
(
i
<
argc
-
1
)
{
if
(
strlen
(
argv
[
++
i
])
>
TSDB_FILENAME_LEN
-
1
)
{
fprintf
(
stderr
,
"config file path: %s overflow max len %d
\n
"
,
argv
[
i
],
TSDB_FILENAME_LEN
-
1
);
exit
(
EXIT_FAILURE
);
}
strcpy
(
configDir
,
argv
[
i
]);
}
else
{
fprintf
(
stderr
,
"Option -c requires an argument
\n
"
);
exit
(
EXIT_FAILURE
);
...
...
src/kit/shell/src/shellLinux.c
浏览文件 @
fb518983
...
...
@@ -80,6 +80,11 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
if
(
wordexp
(
arg
,
&
full_path
,
0
)
!=
0
)
{
fprintf
(
stderr
,
"Invalid path %s
\n
"
,
arg
);
return
-
1
;
}
if
(
strlen
(
full_path
.
we_wordv
[
0
])
>
TSDB_FILENAME_LEN
-
1
)
{
fprintf
(
stderr
,
"config file path: %s overflow max len %d
\n
"
,
full_path
.
we_wordv
[
0
],
TSDB_FILENAME_LEN
-
1
);
wordfree
(
&
full_path
);
return
-
1
;
}
strcpy
(
configDir
,
full_path
.
we_wordv
[
0
]);
wordfree
(
&
full_path
);
...
...
src/kit/shell/src/shellWindows.c
浏览文件 @
fb518983
...
...
@@ -76,8 +76,12 @@ void shellParseArgument(int argc, char *argv[], struct arguments *arguments) {
exit
(
EXIT_FAILURE
);
}
}
else
if
(
strcmp
(
argv
[
i
],
"-c"
)
==
0
)
{
if
(
i
<
argc
-
1
)
{
strcpy
(
configDir
,
argv
[
++
i
]);
if
(
i
<
argc
-
1
)
{
if
(
strlen
(
argv
[
++
i
])
>
TSDB_FILENAME_LEN
-
1
)
{
fprintf
(
stderr
,
"config file path: %s overflow max len %d
\n
"
,
argv
[
i
],
TSDB_FILENAME_LEN
-
1
);
exit
(
EXIT_FAILURE
);
}
strcpy
(
configDir
,
argv
[
i
]);
}
else
{
fprintf
(
stderr
,
"Option -c requires an argument
\n
"
);
exit
(
EXIT_FAILURE
);
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
fb518983
...
...
@@ -49,7 +49,7 @@ static struct argp_option options[] = {
{
0
,
'h'
,
"host"
,
0
,
"The host to connect to TDEngine. Default is localhost."
,
0
},
{
0
,
'p'
,
"port"
,
0
,
"The TCP/IP port number to use for the connection. Default is 0."
,
1
},
{
0
,
'u'
,
"user"
,
0
,
"The TDEngine user name to use when connecting to the server. Default is 'root'."
,
2
},
{
0
,
'
a
'
,
"password"
,
0
,
"The password to use when connecting to the server. Default is 'taosdata'."
,
3
},
{
0
,
'
P
'
,
"password"
,
0
,
"The password to use when connecting to the server. Default is 'taosdata'."
,
3
},
{
0
,
'd'
,
"database"
,
0
,
"Destination database. Default is 'test'."
,
3
},
{
0
,
'm'
,
"table_prefix"
,
0
,
"Table prefix name. Default is 't'."
,
3
},
{
0
,
'M'
,
0
,
0
,
"Use metric flag."
,
13
},
...
...
@@ -58,12 +58,15 @@ static struct argp_option options[] = {
{
0
,
'b'
,
"type_of_cols"
,
0
,
"The data_type of columns: 'INT', 'TINYINT', 'SMALLINT', 'BIGINT', 'FLOAT', 'DOUBLE', 'BINARY'. Default is 'INT'."
,
7
},
{
0
,
'w'
,
"length_of_binary"
,
0
,
"The length of data_type 'BINARY'. Only applicable when type of cols is 'BINARY'. Default is 8"
,
8
},
{
0
,
'l'
,
"num_of_cols_per_record"
,
0
,
"The number of columns per record. Default is 3."
,
8
},
{
0
,
'
c'
,
"num_of_conns"
,
0
,
"The number of connections. Default is 10."
,
9
},
{
0
,
'
T'
,
"num_of_threads"
,
0
,
"The number of threads. Default is 10."
,
9
},
{
0
,
'r'
,
"num_of_records_per_req"
,
0
,
"The number of records per request. Default is 1000."
,
10
},
{
0
,
't'
,
"num_of_tables"
,
0
,
"The number of tables. Default is 10000."
,
11
},
{
0
,
'n'
,
"num_of_records_per_table"
,
0
,
"The number of records per table. Default is 100000."
,
12
},
{
0
,
'
f
'
,
"config_directory"
,
0
,
"Configuration directory. Default is '/etc/taos/'."
,
14
},
{
0
,
'
c
'
,
"config_directory"
,
0
,
"Configuration directory. Default is '/etc/taos/'."
,
14
},
{
0
,
'x'
,
0
,
0
,
"Insert only flag."
,
13
},
{
0
,
'O'
,
"order"
,
0
,
"Insert mode--0: In order, 1: Out of order. Default is in order."
,
14
},
{
0
,
'R'
,
"rate"
,
0
,
"Out of order data's rate--if order=1 Default 10, min: 0, max: 50."
,
14
},
{
0
,
'D'
,
"delete table"
,
0
,
"Delete data methods——0: don't delete, 1: delete by table, 2: delete by stable, 3: delete by database"
,
14
},
{
0
}};
/* Used by main to communicate with parse_opt. */
...
...
@@ -81,11 +84,14 @@ typedef struct DemoArguments {
char
*
datatype
[
MAX_NUM_DATATYPE
];
int
len_of_binary
;
int
num_of_CPR
;
int
num_of_
connection
s
;
int
num_of_
thread
s
;
int
num_of_RPR
;
int
num_of_tables
;
int
num_of_DPT
;
int
abort
;
int
order
;
int
rate
;
int
method_of_delete
;
char
**
arg_list
;
}
SDemoArguments
;
...
...
@@ -106,7 +112,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
case
'u'
:
arguments
->
user
=
arg
;
break
;
case
'
a
'
:
case
'
P
'
:
arguments
->
password
=
arg
;
break
;
case
'o'
:
...
...
@@ -115,8 +121,8 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
case
'q'
:
arguments
->
mode
=
atoi
(
arg
);
break
;
case
'
c
'
:
arguments
->
num_of_
connection
s
=
atoi
(
arg
);
case
'
T
'
:
arguments
->
num_of_
thread
s
=
atoi
(
arg
);
break
;
case
'r'
:
arguments
->
num_of_RPR
=
atoi
(
arg
);
...
...
@@ -176,7 +182,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
case
'x'
:
arguments
->
insert_only
=
true
;
break
;
case
'
f
'
:
case
'
c
'
:
if
(
wordexp
(
arg
,
&
full_path
,
0
)
!=
0
)
{
fprintf
(
stderr
,
"Invalid path %s
\n
"
,
arg
);
return
-
1
;
...
...
@@ -184,6 +190,30 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
taos_options
(
TSDB_OPTION_CONFIGDIR
,
full_path
.
we_wordv
[
0
]);
wordfree
(
&
full_path
);
break
;
case
'O'
:
arguments
->
order
=
atoi
(
arg
);
if
(
arguments
->
order
>
1
||
arguments
->
order
<
0
)
{
arguments
->
order
=
0
;
}
else
if
(
arguments
->
order
==
1
)
{
arguments
->
rate
=
10
;
}
break
;
case
'R'
:
arguments
->
rate
=
atoi
(
arg
);
if
(
arguments
->
order
==
1
&&
(
arguments
->
rate
>
50
||
arguments
->
rate
<=
0
))
{
arguments
->
rate
=
10
;
}
break
;
case
'D'
:
arguments
->
method_of_delete
=
atoi
(
arg
);
if
(
arguments
->
method_of_delete
<
0
||
arguments
->
method_of_delete
>
3
)
{
arguments
->
method_of_delete
=
0
;
}
break
;
case
OPT_ABORT
:
arguments
->
abort
=
1
;
break
;
...
...
@@ -217,6 +247,8 @@ typedef struct {
int
ncols_per_record
;
int
nrecords_per_table
;
int
nrecords_per_request
;
int
data_of_order
;
int
data_of_rate
;
int64_t
start_time
;
bool
do_aggreFunc
;
...
...
@@ -236,6 +268,8 @@ typedef struct {
int
ncols_per_record
;
char
**
data_type
;
int
len_of_binary
;
int
data_of_order
;
int
data_of_rate
;
sem_t
*
mutex_sem
;
int
*
notFinished
;
...
...
@@ -258,6 +292,8 @@ void *readMetric(void *sarg);
void
*
syncWrite
(
void
*
sarg
);
void
*
deleteTable
();
void
*
asyncWrite
(
void
*
sarg
);
void
generateData
(
char
*
res
,
char
**
data_type
,
int
num_of_cols
,
int64_t
timestamp
,
int
len_of_binary
);
...
...
@@ -291,11 +327,14 @@ int main(int argc, char *argv[]) {
},
8
,
// len_of_binary
1
,
// num_of_CPR
1
,
// num_of_connections
1
,
// num_of_connections
/thread
1
,
// num_of_RPR
1
,
// num_of_tables
50000
,
// num_of_DPT
0
,
// abort
0
,
// order
0
,
// rate
0
,
// method_of_delete
NULL
// arg_list
};
...
...
@@ -304,7 +343,7 @@ int main(int argc, char *argv[]) {
// For demo use, change default values for some parameters;
arguments
.
num_of_tables
=
10000
;
arguments
.
num_of_CPR
=
3
;
arguments
.
num_of_
connection
s
=
10
;
arguments
.
num_of_
thread
s
=
10
;
arguments
.
num_of_DPT
=
100000
;
arguments
.
num_of_RPR
=
1000
;
arguments
.
use_metric
=
true
;
...
...
@@ -330,8 +369,11 @@ int main(int argc, char *argv[]) {
char
*
tb_prefix
=
arguments
.
tb_prefix
;
int
len_of_binary
=
arguments
.
len_of_binary
;
int
ncols_per_record
=
arguments
.
num_of_CPR
;
int
order
=
arguments
.
order
;
int
rate
=
arguments
.
rate
;
int
method_of_delete
=
arguments
.
method_of_delete
;
int
ntables
=
arguments
.
num_of_tables
;
int
nconnections
=
arguments
.
num_of_connection
s
;
int
threads
=
arguments
.
num_of_thread
s
;
int
nrecords_per_table
=
arguments
.
num_of_DPT
;
int
nrecords_per_request
=
arguments
.
num_of_RPR
;
bool
use_metric
=
arguments
.
use_metric
;
...
...
@@ -371,12 +413,19 @@ int main(int argc, char *argv[]) {
printf
(
"# Binary Length(If applicable): %d
\n
"
,
(
strcasestr
(
dataString
,
"BINARY"
)
!=
NULL
)
?
len_of_binary
:
-
1
);
printf
(
"# Number of Columns per record: %d
\n
"
,
ncols_per_record
);
printf
(
"# Number of
Connections: %d
\n
"
,
nconnection
s
);
printf
(
"# Number of
Threads: %d
\n
"
,
thread
s
);
printf
(
"# Number of Tables: %d
\n
"
,
ntables
);
printf
(
"# Number of Data per Table: %d
\n
"
,
nrecords_per_table
);
printf
(
"# Records/Request: %d
\n
"
,
nrecords_per_request
);
printf
(
"# Database name: %s
\n
"
,
db_name
);
printf
(
"# Table prefix: %s
\n
"
,
tb_prefix
);
if
(
order
==
1
)
{
printf
(
"# Data order: %d
\n
"
,
order
);
printf
(
"# Data out of order rate: %d
\n
"
,
rate
);
}
printf
(
"# Delete method: %d
\n
"
,
method_of_delete
);
printf
(
"# Test time: %d-%02d-%02d %02d:%02d:%02d
\n
"
,
tm
.
tm_year
+
1900
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
,
tm
.
tm_hour
,
tm
.
tm_min
,
tm
.
tm_sec
);
printf
(
"###################################################################
\n\n
"
);
...
...
@@ -392,12 +441,18 @@ int main(int argc, char *argv[]) {
fprintf
(
fp
,
"# Binary Length(If applicable): %d
\n
"
,
(
strcasestr
(
dataString
,
"BINARY"
)
!=
NULL
)
?
len_of_binary
:
-
1
);
fprintf
(
fp
,
"# Number of Columns per record: %d
\n
"
,
ncols_per_record
);
fprintf
(
fp
,
"# Number of
Connections: %d
\n
"
,
nconnection
s
);
fprintf
(
fp
,
"# Number of
Threads: %d
\n
"
,
thread
s
);
fprintf
(
fp
,
"# Number of Tables: %d
\n
"
,
ntables
);
fprintf
(
fp
,
"# Number of Data per Table: %d
\n
"
,
nrecords_per_table
);
fprintf
(
fp
,
"# Records/Request: %d
\n
"
,
nrecords_per_request
);
fprintf
(
fp
,
"# Database name: %s
\n
"
,
db_name
);
fprintf
(
fp
,
"# Table prefix: %s
\n
"
,
tb_prefix
);
if
(
order
==
1
)
{
printf
(
"# Data order: %d
\n
"
,
order
);
printf
(
"# Data out of order rate: %d
\n
"
,
rate
);
}
fprintf
(
fp
,
"# Test time: %d-%02d-%02d %02d:%02d:%02d
\n
"
,
tm
.
tm_year
+
1900
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
,
tm
.
tm_hour
,
tm
.
tm_min
,
tm
.
tm_sec
);
fprintf
(
fp
,
"###################################################################
\n\n
"
);
...
...
@@ -414,7 +469,7 @@ int main(int argc, char *argv[]) {
sprintf
(
command
,
"drop database %s;"
,
db_name
);
taos_query
(
taos
,
command
);
sleep
(
3
);
sprintf
(
command
,
"create database %s;"
,
db_name
);
taos_query
(
taos
,
command
);
...
...
@@ -479,22 +534,22 @@ int main(int argc, char *argv[]) {
taos_close
(
taos
);
}
/* Wait for table to create */
sleep
(
5
);
/* Insert data */
double
ts
=
getCurrentTime
();
printf
(
"Inserting data......
\n
"
);
pthread_t
*
pids
=
malloc
(
nconnection
s
*
sizeof
(
pthread_t
));
info
*
infos
=
malloc
(
nconnection
s
*
sizeof
(
info
));
pthread_t
*
pids
=
malloc
(
thread
s
*
sizeof
(
pthread_t
));
info
*
infos
=
malloc
(
thread
s
*
sizeof
(
info
));
int
a
=
ntables
/
nconnection
s
;
int
a
=
ntables
/
thread
s
;
if
(
a
<
1
)
{
nconnection
s
=
ntables
;
thread
s
=
ntables
;
a
=
1
;
}
int
b
=
ntables
%
nconnection
s
;
int
b
=
ntables
%
thread
s
;
int
last
=
0
;
for
(
int
i
=
0
;
i
<
nconnection
s
;
i
++
)
{
for
(
int
i
=
0
;
i
<
thread
s
;
i
++
)
{
info
*
t_info
=
infos
+
i
;
t_info
->
threadID
=
i
;
strcpy
(
t_info
->
db_name
,
db_name
);
...
...
@@ -507,6 +562,8 @@ int main(int argc, char *argv[]) {
t_info
->
len_of_binary
=
len_of_binary
;
t_info
->
nrecords_per_request
=
nrecords_per_request
;
t_info
->
start_table_id
=
last
;
t_info
->
data_of_order
=
order
;
t_info
->
data_of_rate
=
rate
;
t_info
->
end_table_id
=
i
<
b
?
last
+
a
:
last
+
a
-
1
;
last
=
t_info
->
end_table_id
+
1
;
...
...
@@ -520,15 +577,15 @@ int main(int argc, char *argv[]) {
pthread_create
(
pids
+
i
,
NULL
,
asyncWrite
,
t_info
);
}
}
for
(
int
i
=
0
;
i
<
nconnection
s
;
i
++
)
{
for
(
int
i
=
0
;
i
<
thread
s
;
i
++
)
{
pthread_join
(
pids
[
i
],
NULL
);
}
double
t
=
getCurrentTime
()
-
ts
;
if
(
query_mode
==
SYNC
)
{
printf
(
"SYNC Insert with %d connections:
\n
"
,
nconnection
s
);
printf
(
"SYNC Insert with %d connections:
\n
"
,
thread
s
);
}
else
{
printf
(
"ASYNC Insert with %d connections:
\n
"
,
nconnection
s
);
printf
(
"ASYNC Insert with %d connections:
\n
"
,
thread
s
);
}
fprintf
(
fp
,
"|%10.d | %10.2f | %10.2f | %10.4f |
\n\n
"
,
...
...
@@ -540,7 +597,7 @@ int main(int argc, char *argv[]) {
t
,
ntables
*
nrecords_per_table
,
nrecords_per_request
,
ntables
*
nrecords_per_table
/
t
);
for
(
int
i
=
0
;
i
<
nconnection
s
;
i
++
)
{
for
(
int
i
=
0
;
i
<
thread
s
;
i
++
)
{
info
*
t_info
=
infos
+
i
;
taos_close
(
t_info
->
taos
);
sem_destroy
(
&
(
t_info
->
mutex_sem
));
...
...
@@ -551,6 +608,55 @@ int main(int argc, char *argv[]) {
free
(
infos
);
fclose
(
fp
);
if
(
method_of_delete
!=
0
)
{
TAOS
*
dtaos
=
taos_connect
(
ip_addr
,
user
,
pass
,
db_name
,
port
);
double
dts
=
getCurrentTime
();
printf
(
"Deleteing %d table(s)......
\n
"
,
ntables
);
switch
(
method_of_delete
)
{
case
1
:
// delete by table
/* Create all the tables; */
for
(
int
i
=
0
;
i
<
ntables
;
i
++
)
{
sprintf
(
command
,
"drop table %s.%s%d;"
,
db_name
,
tb_prefix
,
i
);
queryDB
(
dtaos
,
command
);
}
break
;
case
2
:
// delete by stable
if
(
!
use_metric
)
{
break
;
}
else
{
sprintf
(
command
,
"drop table %s.meters;"
,
db_name
);
queryDB
(
dtaos
,
command
);
}
break
;
case
3
:
// delete by database
sprintf
(
command
,
"drop database %s;"
,
db_name
);
queryDB
(
dtaos
,
command
);
break
;
default:
break
;
}
printf
(
"Table(s) droped!
\n
"
);
taos_close
(
dtaos
);
double
dt
=
getCurrentTime
()
-
dts
;
printf
(
"Spent %.4f seconds to drop %d tables
\n
"
,
dt
,
ntables
);
FILE
*
fp
=
fopen
(
arguments
.
output_file
,
"a"
);
fprintf
(
fp
,
"Spent %.4f seconds to drop %d tables
\n
"
,
dt
,
ntables
);
fclose
(
fp
);
}
if
(
!
insert_only
)
{
// query data
pthread_t
read_id
;
...
...
@@ -735,7 +841,15 @@ void *syncWrite(void *sarg) {
pstr
+=
sprintf
(
pstr
,
"insert into %s.%s%d values"
,
winfo
->
db_name
,
winfo
->
tb_prefix
,
tID
);
int
k
;
for
(
k
=
0
;
k
<
winfo
->
nrecords_per_request
;)
{
generateData
(
data
,
data_type
,
ncols_per_record
,
tmp_time
++
,
len_of_binary
);
int
rand_num
=
rand
()
%
100
;
if
(
winfo
->
data_of_order
==
1
&&
rand_num
<
winfo
->
data_of_rate
)
{
long
d
=
tmp_time
-
rand
()
%
1000000
+
rand_num
;
generateData
(
data
,
data_type
,
ncols_per_record
,
d
,
len_of_binary
);
}
else
{
generateData
(
data
,
data_type
,
ncols_per_record
,
tmp_time
+=
1000
,
len_of_binary
);
}
pstr
+=
sprintf
(
pstr
,
" %s"
,
data
);
inserted
++
;
k
++
;
...
...
@@ -774,6 +888,8 @@ void *asyncWrite(void *sarg) {
tb_info
->
mutex_sem
=
&
(
winfo
->
mutex_sem
);
tb_info
->
notFinished
=
&
(
winfo
->
notFinished
);
tb_info
->
lock_sem
=
&
(
winfo
->
lock_sem
);
tb_info
->
data_of_order
=
winfo
->
data_of_order
;
tb_info
->
data_of_rate
=
winfo
->
data_of_rate
;
/* char buff[BUFFER_SIZE] = "\0"; */
/* sprintf(buff, "insert into %s values (0, 0)", tb_info->tb_name); */
...
...
@@ -815,7 +931,15 @@ void callBack(void *param, TAOS_RES *res, int code) {
pstr
+=
sprintf
(
pstr
,
"insert into %s values"
,
tb_info
->
tb_name
);
for
(
int
i
=
0
;
i
<
tb_info
->
nrecords_per_request
;
i
++
)
{
generateData
(
data
,
datatype
,
ncols_per_record
,
tmp_time
++
,
len_of_binary
);
int
rand_num
=
rand
()
%
100
;
if
(
tb_info
->
data_of_order
==
1
&&
rand_num
<
tb_info
->
data_of_rate
)
{
long
d
=
tmp_time
-
rand
()
%
1000000
+
rand_num
;
generateData
(
data
,
datatype
,
ncols_per_record
,
d
,
len_of_binary
);
}
else
{
generateData
(
data
,
datatype
,
ncols_per_record
,
tmp_time
+=
1000
,
len_of_binary
);
}
pstr
+=
sprintf
(
pstr
,
"%s"
,
data
);
tb_info
->
counter
++
;
...
...
src/mnode/src/mnodeMain.c
浏览文件 @
fb518983
...
...
@@ -160,7 +160,7 @@ void mnodeStopSystem() {
static
void
mnodeInitTimer
()
{
if
(
tsMnodeTmr
==
NULL
)
{
tsMnodeTmr
=
taosTmrInit
(
(
tsMaxShellConns
)
*
3
,
200
,
3600000
,
"MND"
);
tsMnodeTmr
=
taosTmrInit
(
tsMaxShellConns
,
200
,
3600000
,
"MND"
);
}
}
...
...
@@ -185,4 +185,4 @@ static bool mnodeNeedStart() {
bool
mnodeIsRunning
()
{
return
tsMgmtIsRunning
;
}
\ No newline at end of file
}
src/mnode/src/mnodeSdb.c
浏览文件 @
fb518983
...
...
@@ -358,8 +358,8 @@ void sdbIncRef(void *handle, void *pObj) {
SSdbTable
*
pTable
=
handle
;
int32_t
*
pRefCount
=
(
int32_t
*
)(
pObj
+
pTable
->
refCountPos
);
atomic_add_fetch_32
(
pRefCount
,
1
);
if
(
0
&&
(
pTable
->
tableId
==
SDB_TABLE_
MNODE
||
pTable
->
tableId
==
SDB_TABLE_DNODE
))
{
sdbTrace
(
"add ref to table:%s record:%
s:%d"
,
pTable
->
tableName
,
sdbGetKeyStrFromObj
(
pTable
,
pObj
),
*
pRefCount
);
if
(
0
&&
(
pTable
->
tableId
==
SDB_TABLE_
CTABLE
||
pTable
->
tableId
==
SDB_TABLE_DB
))
{
sdbTrace
(
"add ref to table:%s record:%
p:%s:%d"
,
pTable
->
tableName
,
pObj
,
sdbGetKeyStrFromObj
(
pTable
,
pObj
),
*
pRefCount
);
}
}
...
...
@@ -369,13 +369,13 @@ void sdbDecRef(void *handle, void *pObj) {
SSdbTable
*
pTable
=
handle
;
int32_t
*
pRefCount
=
(
int32_t
*
)(
pObj
+
pTable
->
refCountPos
);
int32_t
refCount
=
atomic_sub_fetch_32
(
pRefCount
,
1
);
if
(
0
&&
(
pTable
->
tableId
==
SDB_TABLE_
MNODE
||
pTable
->
tableId
==
SDB_TABLE_DNODE
))
{
sdbTrace
(
"def ref of table:%s record:%
s:%d"
,
pTable
->
tableName
,
sdbGetKeyStrFromObj
(
pTable
,
pObj
),
*
pRefCount
);
if
(
0
&&
(
pTable
->
tableId
==
SDB_TABLE_
CTABLE
||
pTable
->
tableId
==
SDB_TABLE_DB
))
{
sdbTrace
(
"def ref of table:%s record:%
p:%s:%d"
,
pTable
->
tableName
,
pObj
,
sdbGetKeyStrFromObj
(
pTable
,
pObj
),
*
pRefCount
);
}
int8_t
*
updateEnd
=
pObj
+
pTable
->
refCountPos
-
1
;
if
(
refCount
<=
0
&&
*
updateEnd
)
{
sdbTrace
(
"table:%s, record:%
s:%d is destroyed"
,
pTable
->
tableName
,
sdbGetKeyStrFromObj
(
pTable
,
pObj
),
*
pRefCount
);
sdbTrace
(
"table:%s, record:%
p:%s:%d is destroyed"
,
pTable
->
tableName
,
pObj
,
sdbGetKeyStrFromObj
(
pTable
,
pObj
),
*
pRefCount
);
SSdbOper
oper
=
{.
pObj
=
pObj
};
(
*
pTable
->
destroyFp
)(
&
oper
);
}
...
...
src/mnode/src/mnodeShow.c
浏览文件 @
fb518983
...
...
@@ -116,12 +116,6 @@ static int32_t mnodeProcessShowMsg(SMnodeMsg *pMsg) {
return
TSDB_CODE_OPS_NOT_SUPPORT
;
}
int32_t
size
=
sizeof
(
SCMShowRsp
)
+
sizeof
(
SSchema
)
*
TSDB_MAX_COLUMNS
+
TSDB_EXTRA_PAYLOAD_SIZE
;
SCMShowRsp
*
pShowRsp
=
rpcMallocCont
(
size
);
if
(
pShowRsp
==
NULL
)
{
return
TSDB_CODE_SERV_OUT_OF_MEMORY
;
}
int32_t
showObjSize
=
sizeof
(
SShowObj
)
+
htons
(
pShowMsg
->
payloadLen
);
SShowObj
*
pShow
=
(
SShowObj
*
)
calloc
(
1
,
showObjSize
);
pShow
->
signature
=
pShow
;
...
...
@@ -131,7 +125,14 @@ static int32_t mnodeProcessShowMsg(SMnodeMsg *pMsg) {
memcpy
(
pShow
->
payload
,
pShowMsg
->
payload
,
pShow
->
payloadLen
);
pShow
=
mnodeSaveShowObj
(
pShow
,
showObjSize
);
if
(
pShow
==
NULL
)
{
if
(
pShow
==
NULL
)
{
return
TSDB_CODE_SERV_OUT_OF_MEMORY
;
}
int32_t
size
=
sizeof
(
SCMShowRsp
)
+
sizeof
(
SSchema
)
*
TSDB_MAX_COLUMNS
+
TSDB_EXTRA_PAYLOAD_SIZE
;
SCMShowRsp
*
pShowRsp
=
rpcMallocCont
(
size
);
if
(
pShowRsp
==
NULL
)
{
mnodeFreeShowObj
(
pShow
);
return
TSDB_CODE_SERV_OUT_OF_MEMORY
;
}
pShowRsp
->
qhandle
=
htobe64
((
uint64_t
)
pShow
);
...
...
@@ -144,6 +145,7 @@ static int32_t mnodeProcessShowMsg(SMnodeMsg *pMsg) {
return
TSDB_CODE_SUCCESS
;
}
else
{
mError
(
"show:%p, type:%s, failed to get meta, reason:%s"
,
pShow
,
mnodeGetShowType
(
pShowMsg
->
type
),
tstrerror
(
code
));
rpcFreeCont
(
pShowRsp
);
mnodeCleanupShowObj
(
pShow
,
true
);
return
code
;
}
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
fb518983
...
...
@@ -484,7 +484,10 @@ static int32_t mnodeSuperTableActionDecode(SSdbOper *pOper) {
if
(
pStable
==
NULL
)
return
TSDB_CODE_SERV_OUT_OF_MEMORY
;
int32_t
len
=
strlen
(
pOper
->
rowData
);
if
(
len
>
TSDB_TABLE_ID_LEN
)
return
TSDB_CODE_INVALID_TABLE_ID
;
if
(
len
>
TSDB_TABLE_ID_LEN
){
free
(
pStable
);
return
TSDB_CODE_INVALID_TABLE_ID
;
}
pStable
->
info
.
tableId
=
strdup
(
pOper
->
rowData
);
len
++
;
...
...
@@ -1877,38 +1880,25 @@ static SChildTableObj* mnodeGetTableByPos(int32_t vnode, int32_t sid) {
static
int32_t
mnodeProcessTableCfgMsg
(
SMnodeMsg
*
pMsg
)
{
SDMConfigTableMsg
*
pCfg
=
pMsg
->
rpcMsg
.
pCont
;
pCfg
->
dnode
=
htonl
(
pCfg
->
dnode
);
pCfg
->
v
node
=
htonl
(
pCfg
->
vnode
);
pCfg
->
sid
=
htonl
(
pCfg
->
sid
);
mTrace
(
"dnode:%
s, vnode:%d, sid:%d, receive table config msg"
,
taosIpStr
(
pCfg
->
dnode
),
pCfg
->
vnode
,
pCfg
->
sid
);
pCfg
->
dnode
Id
=
htonl
(
pCfg
->
dnodeId
);
pCfg
->
v
gId
=
htonl
(
pCfg
->
vgId
);
pCfg
->
sid
=
htonl
(
pCfg
->
sid
);
mTrace
(
"dnode:%
d, vgId:%d sid:%d, receive table config msg"
,
pCfg
->
dnodeId
,
pCfg
->
vgId
,
pCfg
->
sid
);
SChildTableObj
*
pTable
=
mnodeGetTableByPos
(
pCfg
->
v
node
,
pCfg
->
sid
);
SChildTableObj
*
pTable
=
mnodeGetTableByPos
(
pCfg
->
v
gId
,
pCfg
->
sid
);
if
(
pTable
==
NULL
)
{
mError
(
"dnode:%
s, vnode:%d, sid:%d, table not found"
,
taosIpStr
(
pCfg
->
dnode
),
pCfg
->
vnode
,
pCfg
->
sid
);
mError
(
"dnode:%
d, vgId:%d sid:%d, table not found"
,
pCfg
->
dnodeId
,
pCfg
->
vgId
,
pCfg
->
sid
);
return
TSDB_CODE_NOT_ACTIVE_TABLE
;
}
SMDCreateTableMsg
*
pMDCreate
=
NULL
;
pMDCreate
=
mnodeBuildCreateChildTableMsg
(
NULL
,
(
SChildTableObj
*
)
pTable
);
if
(
pMDCreate
==
NULL
)
{
mnodeDecTableRef
(
pTable
);
return
terrno
;
}
SDnodeObj
*
pDnode
=
mnodeGetDnode
(
pCfg
->
dnode
);
SRpcIpSet
ipSet
=
mnodeGetIpSetFromIp
(
pDnode
->
dnodeEp
);
SRpcMsg
rpcRsp
=
{
.
handle
=
NULL
,
.
pCont
=
pMDCreate
,
.
contLen
=
htonl
(
pMDCreate
->
contLen
),
.
code
=
0
,
.
msgType
=
TSDB_MSG_TYPE_MD_CREATE_TABLE
};
dnodeSendMsgToDnode
(
&
ipSet
,
&
rpcRsp
);
SMDCreateTableMsg
*
pCreate
=
NULL
;
pCreate
=
mnodeBuildCreateChildTableMsg
(
NULL
,
(
SChildTableObj
*
)
pTable
);
mnodeDecTableRef
(
pTable
);
mnodeDecDnodeRef
(
pDnode
);
if
(
pCreate
==
NULL
)
return
terrno
;
pMsg
->
rpcRsp
.
rsp
=
pCreate
;
pMsg
->
rpcRsp
.
len
=
htonl
(
pCreate
->
contLen
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -1926,7 +1916,6 @@ static void mnodeProcessDropChildTableRsp(SRpcMsg *rpcMsg) {
if
(
rpcMsg
->
code
!=
TSDB_CODE_SUCCESS
)
{
mError
(
"table:%s, failed to drop in dnode, reason:%s"
,
pTable
->
info
.
tableId
,
tstrerror
(
rpcMsg
->
code
));
dnodeSendRpcMnodeWriteRsp
(
mnodeMsg
,
rpcMsg
->
code
);
mnodeDecTableRef
(
pTable
);
return
;
}
...
...
@@ -2369,4 +2358,4 @@ static int32_t mnodeRetrieveStreams(SShowObj *pShow, char *data, int32_t rows, v
mnodeDecDbRef
(
pDb
);
return
numOfRows
;
}
\ No newline at end of file
}
src/plugins/http/src/tgHandle.c
浏览文件 @
fb518983
...
...
@@ -281,7 +281,7 @@ int tgReadSchema(char *fileName) {
}
void
tgInitHandle
(
HttpServer
*
pServer
)
{
char
fileName
[
256
]
=
{
0
};
char
fileName
[
TSDB_FILENAME_LEN
*
2
]
=
{
0
};
sprintf
(
fileName
,
"%s/taos.telegraf.cfg"
,
configDir
);
if
(
tgReadSchema
(
fileName
)
<=
0
)
{
tgFreeSchemas
();
...
...
src/util/src/tconfig.c
浏览文件 @
fb518983
...
...
@@ -241,7 +241,12 @@ void taosReadGlobalLogCfg() {
wordexp_t
full_path
;
wordexp
(
configDir
,
&
full_path
,
0
);
if
(
full_path
.
we_wordv
!=
NULL
&&
full_path
.
we_wordv
[
0
]
!=
NULL
)
{
if
(
full_path
.
we_wordv
!=
NULL
&&
full_path
.
we_wordv
[
0
]
!=
NULL
)
{
if
(
strlen
(
full_path
.
we_wordv
[
0
])
>
TSDB_FILENAME_LEN
-
1
)
{
printf
(
"
\n
config file: %s path overflow max len %d, all variables are set to default
\n
"
,
full_path
.
we_wordv
[
0
],
TSDB_FILENAME_LEN
-
1
);
wordfree
(
&
full_path
);
return
;
}
strcpy
(
configDir
,
full_path
.
we_wordv
[
0
]);
}
else
{
printf
(
"configDir:%s not there, use default value: /etc/taos"
,
configDir
);
...
...
src/util/src/tqueue.c
浏览文件 @
fb518983
...
...
@@ -18,24 +18,24 @@
#include "taoserror.h"
#include "tqueue.h"
typedef
struct
_taos_q
node
{
typedef
struct
STaosQ
node
{
int
type
;
struct
_taos_qnode
*
next
;
struct
STaosQnode
*
next
;
char
item
[];
}
STaosQnode
;
typedef
struct
_taos_q
{
typedef
struct
STaosQueue
{
int32_t
itemSize
;
int32_t
numOfItems
;
struct
_taos_qnode
*
head
;
struct
_taos_qnode
*
tail
;
struct
_taos_q
*
next
;
// for queue set
struct
_taos_qset
*
qset
;
// for queue set
struct
STaosQnode
*
head
;
struct
STaosQnode
*
tail
;
struct
STaosQueue
*
next
;
// for queue set
struct
STaosQset
*
qset
;
// for queue set
void
*
ahandle
;
// for queue set
pthread_mutex_t
mutex
;
}
STaosQueue
;
typedef
struct
_taos_q
set
{
typedef
struct
STaosQ
set
{
STaosQueue
*
head
;
STaosQueue
*
current
;
pthread_mutex_t
mutex
;
...
...
@@ -44,7 +44,7 @@ typedef struct _taos_qset {
tsem_t
sem
;
}
STaosQset
;
typedef
struct
_taos_q
all
{
typedef
struct
STaosQ
all
{
STaosQnode
*
current
;
STaosQnode
*
start
;
int32_t
itemSize
;
...
...
@@ -95,6 +95,7 @@ void *taosAllocateQitem(int size) {
void
taosFreeQitem
(
void
*
param
)
{
if
(
param
==
NULL
)
return
;
uTrace
(
"item:%p is freed"
,
param
);
char
*
temp
=
(
char
*
)
param
;
temp
-=
sizeof
(
STaosQnode
);
free
(
temp
);
...
...
@@ -104,6 +105,7 @@ int taosWriteQitem(taos_queue param, int type, void *item) {
STaosQueue
*
queue
=
(
STaosQueue
*
)
param
;
STaosQnode
*
pNode
=
(
STaosQnode
*
)(((
char
*
)
item
)
-
sizeof
(
STaosQnode
));
pNode
->
type
=
type
;
pNode
->
next
=
NULL
;
pthread_mutex_lock
(
&
queue
->
mutex
);
...
...
@@ -143,7 +145,7 @@ int taosReadQitem(taos_queue param, int *type, void **pitem) {
queue
->
numOfItems
--
;
if
(
queue
->
qset
)
atomic_sub_fetch_32
(
&
queue
->
qset
->
numOfItems
,
1
);
code
=
1
;
uTrace
(
"item:%p is read out from queue
, items:%d"
,
*
pitem
,
queue
->
numOfItems
);
uTrace
(
"item:%p is read out from queue
:%p, type:%d items:%d"
,
*
pitem
,
*
type
,
queue
->
numOfItems
);
}
pthread_mutex_unlock
(
&
queue
->
mutex
);
...
...
@@ -337,6 +339,7 @@ int taosReadQitemFromQset(taos_qset param, int *type, void **pitem, void **phand
queue
->
numOfItems
--
;
atomic_sub_fetch_32
(
&
qset
->
numOfItems
,
1
);
code
=
1
;
uTrace
(
"item:%p is read out from queue:%p, type:%d items:%d"
,
*
pitem
,
queue
,
*
type
,
queue
->
numOfItems
);
}
pthread_mutex_unlock
(
&
queue
->
mutex
);
...
...
tests/pytest/random-test/random-test-multi-threading.py
0 → 100644
浏览文件 @
fb518983
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
sys
import
random
import
threading
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
from
util.dnodes
import
*
current_tb
=
""
last_tb
=
""
written
=
0
class
Test
(
threading
.
Thread
):
def
__init__
(
self
,
threadId
,
name
,
sleepTime
):
threading
.
Thread
.
__init__
(
self
)
self
.
threadId
=
threadId
self
.
name
=
name
self
.
sleepTime
=
sleepTime
self
.
threadLock
=
threading
.
Lock
()
def
create_table
(
self
):
global
current_tb
global
last_tb
global
written
tdLog
.
info
(
"create a table"
)
current_tb
=
"tb%d"
%
int
(
round
(
time
.
time
()
*
1000
))
tdLog
.
info
(
"current table %s"
%
current_tb
)
if
(
current_tb
==
last_tb
):
return
else
:
tdSql
.
execute
(
'create table %s (ts timestamp, speed int)'
%
current_tb
)
last_tb
=
current_tb
written
=
0
def
insert_data
(
self
):
global
current_tb
global
last_tb
global
written
tdLog
.
info
(
"will insert data to table"
)
if
(
current_tb
==
""
):
tdLog
.
info
(
"no table, create first"
)
self
.
create_table
()
tdLog
.
info
(
"insert data to table"
)
for
i
in
range
(
0
,
10
):
self
.
threadLock
.
acquire
()
insertRows
=
1000
tdLog
.
info
(
"insert %d rows to %s"
%
(
insertRows
,
current_tb
))
for
j
in
range
(
0
,
insertRows
):
ret
=
tdSql
.
execute
(
'insert into %s values (now + %dm, %d)'
%
(
current_tb
,
j
,
j
))
written
=
written
+
1
self
.
threadLock
.
release
()
def
query_data
(
self
):
global
current_tb
global
last_tb
global
written
if
(
written
>
0
):
tdLog
.
info
(
"query data from table"
)
tdSql
.
query
(
"select * from %s"
%
last_tb
)
tdSql
.
checkRows
(
written
)
def
create_stable
(
self
):
global
current_tb
global
last_tb
global
written
tdLog
.
info
(
"create a super table"
)
def
restart_database
(
self
):
global
current_tb
global
last_tb
global
written
tdLog
.
info
(
"restart databae"
)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
5
)
def
force_restart
(
self
):
global
current_tb
global
last_tb
global
written
tdLog
.
info
(
"force restart database"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
5
)
def
drop_table
(
self
):
global
current_tb
global
last_tb
global
written
for
i
in
range
(
0
,
10
):
self
.
threadLock
.
acquire
()
tdLog
.
info
(
"current_tb %s"
%
current_tb
)
if
(
current_tb
!=
""
):
tdLog
.
info
(
"drop current tb %s"
%
current_tb
)
tdSql
.
execute
(
"drop table %s"
%
current_tb
)
current_tb
=
""
last_tb
=
""
written
=
0
tdLog
.
sleep
(
self
.
sleepTime
)
self
.
threadLock
.
release
()
def
reset_query_cache
(
self
):
global
current_tb
global
last_tb
global
written
tdLog
.
info
(
"reset query cache"
)
tdSql
.
execute
(
"reset query cache"
)
tdLog
.
sleep
(
1
)
def
reset_database
(
self
):
global
current_tb
global
last_tb
global
written
tdLog
.
info
(
"reset database"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
deploy
(
1
)
current_tb
=
""
last_tb
=
""
written
=
0
tdDnodes
.
start
(
1
)
tdSql
.
prepare
()
def
delete_datafiles
(
self
):
global
current_tb
global
last_tb
global
written
tdLog
.
info
(
"delete data files"
)
dnodesDir
=
tdDnodes
.
getDnodesRootDir
()
dataDir
=
dnodesDir
+
'/dnode1/*'
deleteCmd
=
'rm -rf %s'
%
dataDir
os
.
system
(
deleteCmd
)
current_tb
=
""
last_tb
=
""
written
=
0
tdDnodes
.
start
(
1
)
tdSql
.
prepare
()
def
run
(
self
):
switch
=
{
1
:
self
.
create_table
,
2
:
self
.
insert_data
,
3
:
self
.
query_data
,
4
:
self
.
create_stable
,
5
:
self
.
restart_database
,
6
:
self
.
force_restart
,
7
:
self
.
drop_table
,
8
:
self
.
reset_query_cache
,
9
:
self
.
reset_database
,
10
:
self
.
delete_datafiles
,
}
switch
.
get
(
self
.
threadId
,
lambda
:
"ERROR"
)()
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
run
(
self
):
tdSql
.
prepare
()
test1
=
Test
(
2
,
"insert_data"
,
1
)
test2
=
Test
(
7
,
"drop_table"
,
2
)
test1
.
start
()
test2
.
start
()
test1
.
join
()
test2
.
join
()
tdLog
.
info
(
"end of test"
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/util/dnodes.py
浏览文件 @
fb518983
...
...
@@ -163,7 +163,7 @@ class TDDnode:
self
.
cfg
(
"clog"
,
"1"
)
self
.
cfg
(
"statusInterval"
,
"1"
)
self
.
cfg
(
"numOfTotalVnodes"
,
"64"
)
self
.
cfg
(
"numOfM
Peer
s"
,
"3"
)
self
.
cfg
(
"numOfM
node
s"
,
"3"
)
self
.
cfg
(
"numOfThreadsPerCore"
,
"2.0"
)
self
.
cfg
(
"monitor"
,
"0"
)
self
.
cfg
(
"maxVnodeConnections"
,
"30000"
)
...
...
tests/script/general/alter/count.sim
浏览文件 @
fb518983
...
...
@@ -3,7 +3,7 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
print ========= start dnode1 as master
...
...
tests/script/general/alter/import.sim
浏览文件 @
fb518983
...
...
@@ -3,7 +3,7 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
print ========= start dnode1 as master
...
...
tests/script/general/db/backup/keep.sim
浏览文件 @
fb518983
...
...
@@ -9,9 +9,9 @@ system sh/deploy.sh -n dnode3 -i 3
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 dnode3 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/general/db/delete_reuse1.sim
浏览文件 @
fb518983
...
...
@@ -10,10 +10,10 @@ system sh/cfg.sh -n dnode2 -c walLevel -v 0
system sh/cfg.sh -n dnode3 -c walLevel -v 0
system sh/cfg.sh -n dnode4 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/general/db/delete_reuse2.sim
浏览文件 @
fb518983
...
...
@@ -10,10 +10,10 @@ system sh/cfg.sh -n dnode2 -c walLevel -v 0
system sh/cfg.sh -n dnode3 -c walLevel -v 0
system sh/cfg.sh -n dnode4 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/general/db/delete_writing1.sim
浏览文件 @
fb518983
...
...
@@ -10,10 +10,10 @@ system sh/cfg.sh -n dnode2 -c walLevel -v 0
system sh/cfg.sh -n dnode3 -c walLevel -v 0
system sh/cfg.sh -n dnode4 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/general/import/basic.sim
浏览文件 @
fb518983
...
...
@@ -4,10 +4,10 @@ system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 10
...
...
tests/script/general/import/commit.sim
浏览文件 @
fb518983
...
...
@@ -4,10 +4,10 @@ system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 10
...
...
tests/script/general/import/large.sim
浏览文件 @
fb518983
...
...
@@ -4,10 +4,10 @@ system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 10
...
...
tests/script/general/import/replica1.sim
浏览文件 @
fb518983
...
...
@@ -5,10 +5,10 @@ system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 10
...
...
tests/script/general/table/delete_reuse1.sim
浏览文件 @
fb518983
...
...
@@ -9,10 +9,10 @@ system sh/cfg.sh -n dnode2 -c walLevel -v 0
system sh/cfg.sh -n dnode3 -c walLevel -v 0
system sh/cfg.sh -n dnode4 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/general/table/delete_reuse2.sim
浏览文件 @
fb518983
...
...
@@ -9,10 +9,10 @@ system sh/cfg.sh -n dnode2 -c walLevel -v 0
system sh/cfg.sh -n dnode3 -c walLevel -v 0
system sh/cfg.sh -n dnode4 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/general/table/delete_writing.sim
浏览文件 @
fb518983
...
...
@@ -9,10 +9,10 @@ system sh/cfg.sh -n dnode2 -c walLevel -v 0
system sh/cfg.sh -n dnode3 -c walLevel -v 0
system sh/cfg.sh -n dnode4 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/sh/clear.sh
浏览文件 @
fb518983
...
...
@@ -111,7 +111,7 @@ echo "clog 0" >> $TAOS_CFG
echo
"statusInterval 1"
>>
$TAOS_CFG
echo
"numOfTotalVnodes 4"
>>
$TAOS_CFG
echo
"asyncLog 0"
>>
$TAOS_CFG
echo
"numOfM
Peer
s 1"
>>
$TAOS_CFG
echo
"numOfM
node
s 1"
>>
$TAOS_CFG
echo
"locale en_US.UTF-8"
>>
$TAOS_CFG
tests/script/sh/deploy.sh
浏览文件 @
fb518983
...
...
@@ -119,7 +119,7 @@ echo "clog 2" >> $TAOS_CFG
echo
"statusInterval 1"
>>
$TAOS_CFG
echo
"numOfTotalVnodes 4"
>>
$TAOS_CFG
echo
"asyncLog 0"
>>
$TAOS_CFG
echo
"numOfM
Peer
s 1"
>>
$TAOS_CFG
echo
"numOfM
node
s 1"
>>
$TAOS_CFG
echo
"locale en_US.UTF-8"
>>
$TAOS_CFG
echo
"anyIp 0"
>>
$TAOS_CFG
...
...
tests/script/tmp/mnodes.sim
浏览文件 @
fb518983
...
...
@@ -2,6 +2,6 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 3
tests/script/tmp/prepare.sim
浏览文件 @
fb518983
...
...
@@ -10,10 +10,10 @@ system sh/cfg.sh -n dnode2 -c walLevel -v 2
system sh/cfg.sh -n dnode3 -c walLevel -v 2
system sh/cfg.sh -n dnode4 -c walLevel -v 2
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim
浏览文件 @
fb518983
...
...
@@ -5,11 +5,11 @@ system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode5 -i 5
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode5 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode5 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode2 -c walLevel -v 1
...
...
tests/script/unique/arbitrator/replica_changeWithArbitrator.sim
浏览文件 @
fb518983
...
...
@@ -3,9 +3,9 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode2 -c walLevel -v 1
...
...
tests/script/unique/cluster/balance1.sim
浏览文件 @
fb518983
...
...
@@ -17,14 +17,14 @@ system sh/cfg.sh -n dnode6 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode7 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode8 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode4 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode5 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode6 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode7 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode8 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode5 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode6 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode7 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode8 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 0
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 0
...
...
tests/script/unique/cluster/balance2.sim
浏览文件 @
fb518983
...
...
@@ -17,14 +17,14 @@ system sh/cfg.sh -n dnode6 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode7 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode8 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode5 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode6 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode7 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode8 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode5 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode6 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode7 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode8 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode1 -c wallevel -v 1
system sh/cfg.sh -n dnode2 -c wallevel -v 1
...
...
tests/script/unique/cluster/balance3.sim
浏览文件 @
fb518983
...
...
@@ -18,14 +18,14 @@ system sh/cfg.sh -n dnode6 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode7 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode8 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode1 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode4 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode5 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode6 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode7 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode8 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode5 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode6 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode7 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode8 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 0
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 0
...
...
tests/script/unique/column/replica3.sim
浏览文件 @
fb518983
...
...
@@ -6,9 +6,9 @@ system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c num
ofMpeer
s -v 3
system sh/cfg.sh -n dnode2 -c num
ofMpeer
s -v 3
system sh/cfg.sh -n dnode3 -c num
ofMpeer
s -v 3
system sh/cfg.sh -n dnode1 -c num
OfMnode
s -v 3
system sh/cfg.sh -n dnode2 -c num
OfMnode
s -v 3
system sh/cfg.sh -n dnode3 -c num
OfMnode
s -v 3
system sh/exec_up.sh -n dnode1 -s start
sql connect
...
...
tests/script/unique/db/commit.sim
浏览文件 @
fb518983
...
...
@@ -6,9 +6,9 @@ system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c walLevel -v 2
system sh/cfg.sh -n dnode2 -c walLevel -v 2
system sh/cfg.sh -n dnode3 -c walLevel -v 2
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/unique/db/delete.sim
浏览文件 @
fb518983
...
...
@@ -6,9 +6,9 @@ system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 10
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10
...
...
tests/script/unique/db/delete_part.sim
浏览文件 @
fb518983
...
...
@@ -9,10 +9,10 @@ system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode4 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/unique/db/replica_add12.sim
浏览文件 @
fb518983
...
...
@@ -10,10 +10,10 @@ system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode4 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/unique/db/replica_add13.sim
浏览文件 @
fb518983
...
...
@@ -10,10 +10,10 @@ system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode4 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/unique/db/replica_add23.sim
浏览文件 @
fb518983
...
...
@@ -10,10 +10,10 @@ system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode4 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/unique/db/replica_part.sim
浏览文件 @
fb518983
...
...
@@ -7,9 +7,9 @@ system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/unique/db/replica_reduce21.sim
浏览文件 @
fb518983
...
...
@@ -7,9 +7,9 @@ system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/unique/db/replica_reduce31.sim
浏览文件 @
fb518983
...
...
@@ -7,9 +7,9 @@ system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/unique/db/replica_reduce32.sim
浏览文件 @
fb518983
...
...
@@ -7,9 +7,9 @@ system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/unique/dnode/alternativeRole.sim
浏览文件 @
fb518983
...
...
@@ -12,9 +12,9 @@ system sh/cfg.sh -n dnode1 -c wallevel -v 1
system sh/cfg.sh -n dnode2 -c wallevel -v 1
system sh/cfg.sh -n dnode3 -c wallevel -v 1
system sh/cfg.sh -n dnode1 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
peer
s -v 3
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 3
print ========== step1
system sh/exec_up.sh -n dnode1 -s start
...
...
tests/script/unique/import/replica2.sim
浏览文件 @
fb518983
...
...
@@ -5,10 +5,10 @@ system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 10
...
...
tests/script/unique/import/replica3.sim
浏览文件 @
fb518983
...
...
@@ -5,10 +5,10 @@ system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 10
...
...
tests/script/unique/mnode/mgmt22.sim
浏览文件 @
fb518983
...
...
@@ -3,9 +3,9 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 2
print ============== step1
system sh/exec_up.sh -n dnode1 -s start
...
...
tests/script/unique/mnode/mgmt23.sim
浏览文件 @
fb518983
...
...
@@ -3,9 +3,9 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 2
print ============== step1
system sh/exec_up.sh -n dnode1 -s start
...
...
@@ -91,7 +91,7 @@ print ============== step5
sleep 2000
sql create dnode $hostname2
system sh/deploy.sh -n dnode2 -i 2
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 2
system sh/exec_up.sh -n dnode2 -s start
sleep 8000
...
...
tests/script/unique/mnode/mgmt24.sim
浏览文件 @
fb518983
...
...
@@ -3,9 +3,9 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 2
print ============== step1
system sh/exec_up.sh -n dnode1 -s start
...
...
tests/script/unique/mnode/mgmt25.sim
浏览文件 @
fb518983
...
...
@@ -3,9 +3,9 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 2
print ============== step1
system sh/exec_up.sh -n dnode1 -s start
...
...
tests/script/unique/mnode/mgmt26.sim
浏览文件 @
fb518983
...
...
@@ -3,9 +3,9 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 2
print ============== step1
system sh/exec_up.sh -n dnode1 -s start
...
...
@@ -89,7 +89,7 @@ endi
print ============== step5
system sh/exec_up.sh -n dnode2 -s stop
system sh/deploy.sh -n dnode2 -i 2
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 2
sleep 5000
system sh/exec_up.sh -n dnode2 -s start
sql create dnode $hostname2
...
...
tests/script/unique/mnode/mgmt33.sim
浏览文件 @
fb518983
...
...
@@ -3,9 +3,9 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 3
print ============== step1
system sh/exec_up.sh -n dnode1 -s start
...
...
@@ -97,7 +97,7 @@ system sh/exec_up.sh -n dnode2 -s stop
sleep 3000
system sh/deploy.sh -n dnode2 -i 2
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 3
system sh/exec_up.sh -n dnode2 -s start
print ============== step5
...
...
tests/script/unique/mnode/mgmt34.sim
浏览文件 @
fb518983
...
...
@@ -5,10 +5,10 @@ system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 3
print ============== step1
system sh/exec_up.sh -n dnode1 -s start
...
...
@@ -145,7 +145,7 @@ system sh/exec_up.sh -n dnode2 -s stop
sleep 3000
system sh/deploy.sh -n dnode2 -i 2
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 3
system sh/exec_up.sh -n dnode2 -s start
print ============== step6
...
...
tests/script/unique/mnode/mgmtr2.sim
浏览文件 @
fb518983
...
...
@@ -3,9 +3,9 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 2
print ============== step1
system sh/exec_up.sh -n dnode1 -s start
...
...
tests/script/unique/stream/metrics_balance.sim
浏览文件 @
fb518983
...
...
@@ -18,8 +18,8 @@ system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 4
system sh/cfg.sh -n dnode1 -c tableMetaKeepTimer -v 5
system sh/cfg.sh -n dnode2 -c tableMetaKeepTimer -v 5
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 2
$dbPrefix = db
$tbPrefix = tb
...
...
tests/script/unique/stream/metrics_vnode_stop.sim
浏览文件 @
fb518983
...
...
@@ -6,8 +6,8 @@ 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 numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 2
system sh/exec.sh -n dnode1 -s start
sql connect
...
...
tests/script/unique/stream/table_balance.sim
浏览文件 @
fb518983
...
...
@@ -16,8 +16,8 @@ system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 0
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 0
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 2
$dbPrefix = tb_db
$tbPrefix = tb_tb
...
...
tests/script/unique/stream/table_move.sim
浏览文件 @
fb518983
...
...
@@ -40,10 +40,10 @@ system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 3
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 3
system sh/cfg.sh -n dnode1 -c maxVnodeConnections -v 1000
system sh/cfg.sh -n dnode1 -c maxMeterConnections -v 1000
...
...
tests/script/unique/stream/table_vnode_stop.sim
浏览文件 @
fb518983
...
...
@@ -6,8 +6,8 @@ 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 numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 2
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 2
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 2
system sh/exec.sh -n dnode1 -s start
sql connect
...
...
tests/script/unique/vnode/many.sim
浏览文件 @
fb518983
...
...
@@ -8,10 +8,10 @@ system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode4 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c num
ofMpeer
s -v 1
system sh/cfg.sh -n dnode2 -c num
ofMpeer
s -v 1
system sh/cfg.sh -n dnode3 -c num
ofMpeer
s -v 1
system sh/cfg.sh -n dnode4 -c num
ofMpeer
s -v 1
system sh/cfg.sh -n dnode1 -c num
OfMnode
s -v 1
system sh/cfg.sh -n dnode2 -c num
OfMnode
s -v 1
system sh/cfg.sh -n dnode3 -c num
OfMnode
s -v 1
system sh/cfg.sh -n dnode4 -c num
OfMnode
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/unique/vnode/replica2_basic2.sim
浏览文件 @
fb518983
...
...
@@ -10,10 +10,10 @@ system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode4 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
Peer
s -v 1
system sh/cfg.sh -n dnode1 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode2 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode3 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode4 -c numOfM
node
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/unique/vnode/replica2_repeat.sim
浏览文件 @
fb518983
...
...
@@ -8,10 +8,10 @@ system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode4 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c num
ofMpeer
s -v 1
system sh/cfg.sh -n dnode2 -c num
ofMpeer
s -v 1
system sh/cfg.sh -n dnode3 -c num
ofMpeer
s -v 1
system sh/cfg.sh -n dnode4 -c num
ofMpeer
s -v 1
system sh/cfg.sh -n dnode1 -c num
OfMnode
s -v 1
system sh/cfg.sh -n dnode2 -c num
OfMnode
s -v 1
system sh/cfg.sh -n dnode3 -c num
OfMnode
s -v 1
system sh/cfg.sh -n dnode4 -c num
OfMnode
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/unique/vnode/replica3_basic.sim
浏览文件 @
fb518983
...
...
@@ -6,9 +6,9 @@ system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c num
ofMpeer
s -v 3
system sh/cfg.sh -n dnode2 -c num
ofMpeer
s -v 3
system sh/cfg.sh -n dnode3 -c num
ofMpeer
s -v 3
system sh/cfg.sh -n dnode1 -c num
OfMnode
s -v 3
system sh/cfg.sh -n dnode2 -c num
OfMnode
s -v 3
system sh/cfg.sh -n dnode3 -c num
OfMnode
s -v 3
system sh/exec_up.sh -n dnode1 -s start
sql connect
...
...
tests/script/unique/vnode/replica3_repeat.sim
浏览文件 @
fb518983
...
...
@@ -8,10 +8,10 @@ system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode4 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c num
ofMpeer
s -v 1
system sh/cfg.sh -n dnode2 -c num
ofMpeer
s -v 1
system sh/cfg.sh -n dnode3 -c num
ofMpeer
s -v 1
system sh/cfg.sh -n dnode4 -c num
ofMpeer
s -v 1
system sh/cfg.sh -n dnode1 -c num
OfMnode
s -v 1
system sh/cfg.sh -n dnode2 -c num
OfMnode
s -v 1
system sh/cfg.sh -n dnode3 -c num
OfMnode
s -v 1
system sh/cfg.sh -n dnode4 -c num
OfMnode
s -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
...
...
tests/script/unique/vnode/replica3_vgroup.sim
浏览文件 @
fb518983
...
...
@@ -6,9 +6,9 @@ system sh/deploy.sh -n dnode3 -i 3
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode2 -c wallevel -v 2
system sh/cfg.sh -n dnode3 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c num
ofMpeer
s -v 3
system sh/cfg.sh -n dnode2 -c num
ofMpeer
s -v 3
system sh/cfg.sh -n dnode3 -c num
ofMpeer
s -v 3
system sh/cfg.sh -n dnode1 -c num
OfMnode
s -v 3
system sh/cfg.sh -n dnode2 -c num
OfMnode
s -v 3
system sh/cfg.sh -n dnode3 -c num
OfMnode
s -v 3
system sh/exec_up.sh -n dnode1 -s start
sql connect
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录