Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_50753323
TDengine
提交
baaa1ecf
T
TDengine
项目概览
qq_50753323
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
baaa1ecf
编写于
5月 02, 2020
作者:
S
slguan
提交者:
GitHub
5月 02, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1777 from taosdata/feature/cluster
Feature/cluster
上级
625deb01
69dbb70a
变更
22
显示空白变更内容
内联
并排
Showing
22 changed file
with
122 addition
and
1679 deletion
+122
-1679
src/mnode/inc/mgmtDef.h
src/mnode/inc/mgmtDef.h
+3
-3
src/mnode/src/mgmtDb.c
src/mnode/src/mgmtDb.c
+7
-0
src/mnode/src/mgmtSdb.c
src/mnode/src/mgmtSdb.c
+4
-2
src/mnode/src/mgmtTable.c
src/mnode/src/mgmtTable.c
+25
-8
tests/script/unique/cluster/backup/balance4.sim
tests/script/unique/cluster/backup/balance4.sim
+0
-759
tests/script/unique/cluster/backup/balance5.sim
tests/script/unique/cluster/backup/balance5.sim
+0
-413
tests/script/unique/cluster/backup/balancex.sim
tests/script/unique/cluster/backup/balancex.sim
+0
-372
tests/script/unique/cluster/testSuite.sim
tests/script/unique/cluster/testSuite.sim
+5
-5
tests/script/unique/column/replica3.sim
tests/script/unique/column/replica3.sim
+12
-15
tests/script/unique/column/testSuite.sim
tests/script/unique/column/testSuite.sim
+1
-1
tests/script/unique/db/replica_add13.sim
tests/script/unique/db/replica_add13.sim
+8
-12
tests/script/unique/db/replica_add23.sim
tests/script/unique/db/replica_add23.sim
+8
-12
tests/script/unique/db/replica_part.sim
tests/script/unique/db/replica_part.sim
+0
-2
tests/script/unique/db/replica_reduce21.sim
tests/script/unique/db/replica_reduce21.sim
+0
-2
tests/script/unique/db/replica_reduce31.sim
tests/script/unique/db/replica_reduce31.sim
+0
-2
tests/script/unique/db/replica_reduce32.sim
tests/script/unique/db/replica_reduce32.sim
+23
-39
tests/script/unique/metrics/testSuite.sim
tests/script/unique/metrics/testSuite.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
+1
-6
tests/script/unique/mnode/testSuite.sim
tests/script/unique/mnode/testSuite.sim
+2
-2
tests/script/unique/stream/testSuite.sim
tests/script/unique/stream/testSuite.sim
+15
-15
tests/script/unique/vnode/replica2_basic.sim
tests/script/unique/vnode/replica2_basic.sim
+0
-1
未找到文件。
src/mnode/inc/mgmtDef.h
浏览文件 @
baaa1ecf
...
...
@@ -32,8 +32,8 @@ struct SMnodeObj;
typedef
struct
SDnodeObj
{
int32_t
dnodeId
;
uint16_t
dnodePort
;
char
dnodeFqdn
[
TSDB_FQDN_LEN
];
char
dnodeEp
[
TSDB_FQDN_LEN
];
char
dnodeFqdn
[
TSDB_FQDN_LEN
+
1
];
char
dnodeEp
[
TSDB_FQDN_LEN
+
1
];
int64_t
createdTime
;
uint32_t
lastAccess
;
int32_t
openVnodes
;
...
...
@@ -96,7 +96,7 @@ typedef struct {
int32_t
numOfColumns
;
//used by normal table
int32_t
sid
;
int32_t
vgId
;
char
superTableId
[
TSDB_TABLE_ID_LEN
+
1
]
;
uint64_t
suid
;
int32_t
sqlLen
;
int8_t
reserved
[
1
];
int8_t
updateEnd
[
1
];
...
...
src/mnode/src/mgmtDb.c
浏览文件 @
baaa1ecf
...
...
@@ -261,6 +261,13 @@ static int32_t mgmtCheckDbCfg(SDbCfg *pCfg) {
return
TSDB_CODE_INVALID_OPTION
;
}
#ifndef _SYNC
if
(
pCfg
->
replications
!=
1
)
{
mError
(
"invalid db option replications:%d can only be 1 in this version"
,
pCfg
->
replications
);
return
TSDB_CODE_INVALID_OPTION
;
}
#endif
return
TSDB_CODE_SUCCESS
;
}
...
...
src/mnode/src/mgmtSdb.c
浏览文件 @
baaa1ecf
...
...
@@ -184,6 +184,7 @@ void sdbUpdateMnodeRoles() {
if
(
pMnode
!=
NULL
)
{
pMnode
->
role
=
roles
.
role
[
i
];
sdbPrint
(
"mnode:%d, role:%s"
,
pMnode
->
mnodeId
,
mgmtGetMnodeRoleStr
(
pMnode
->
role
));
if
(
pMnode
->
mnodeId
==
dnodeGetDnodeId
())
tsSdbObj
.
role
=
pMnode
->
role
;
mgmtDecMnodeRef
(
pMnode
);
}
}
...
...
@@ -221,7 +222,7 @@ static int32_t sdbForwardToPeer(SWalHead *pHead) {
int32_t
code
=
syncForwardToPeer
(
tsSdbObj
.
sync
,
pHead
,
(
void
*
)
pHead
->
version
);
if
(
code
>
0
)
{
sdbTrace
(
"forward request is sent, version:%"
PRIu64
",
result:%s"
,
pHead
->
version
,
tstrerror
(
code
)
);
sdbTrace
(
"forward request is sent, version:%"
PRIu64
",
code:%d"
,
pHead
->
version
,
code
);
sem_wait
(
&
tsSdbObj
.
sem
);
return
tsSdbObj
.
code
;
}
...
...
@@ -294,6 +295,7 @@ void sdbUpdateSync() {
}
else
{
tsSdbObj
.
sync
=
syncStart
(
&
syncInfo
);
}
sdbUpdateMnodeRoles
();
}
int32_t
sdbInit
()
{
...
...
src/mnode/src/mgmtTable.c
浏览文件 @
baaa1ecf
...
...
@@ -47,6 +47,7 @@ static int32_t tsChildTableUpdateSize;
static
int32_t
tsSuperTableUpdateSize
;
static
void
*
mgmtGetChildTable
(
char
*
tableId
);
static
void
*
mgmtGetSuperTable
(
char
*
tableId
);
static
void
*
mgmtGetSuperTableByUid
(
uint64_t
uid
);
static
void
mgmtDropAllChildTablesInStable
(
SSuperTableObj
*
pStable
);
static
void
mgmtAddTableIntoStable
(
SSuperTableObj
*
pStable
,
SChildTableObj
*
pCtable
);
static
void
mgmtRemoveTableFromStable
(
SSuperTableObj
*
pStable
,
SChildTableObj
*
pCtable
);
...
...
@@ -118,7 +119,7 @@ static int32_t mgmtChildTableActionInsert(SSdbOper *pOper) {
if
(
pTable
->
info
.
type
==
TSDB_CHILD_TABLE
)
{
// add ref
pTable
->
superTable
=
mgmtGetSuperTable
(
pTable
->
superTableI
d
);
pTable
->
superTable
=
mgmtGetSuperTable
ByUid
(
pTable
->
sui
d
);
mgmtAddTableIntoStable
(
pTable
->
superTable
,
pTable
);
grantAdd
(
TSDB_GRANT_TIMESERIES
,
pTable
->
superTable
->
numOfColumns
-
1
);
pAcct
->
acctInfo
.
numOfTimeSeries
+=
(
pTable
->
superTable
->
numOfColumns
-
1
);
...
...
@@ -308,9 +309,9 @@ static int32_t mgmtChildTableActionRestored() {
}
if
(
pTable
->
info
.
type
==
TSDB_CHILD_TABLE
)
{
SSuperTableObj
*
pSuperTable
=
mgmtGetSuperTable
(
pTable
->
superTableI
d
);
SSuperTableObj
*
pSuperTable
=
mgmtGetSuperTable
ByUid
(
pTable
->
sui
d
);
if
(
pSuperTable
==
NULL
)
{
mError
(
"ctable:%s, stable:%
s not exist"
,
pTable
->
info
.
tableId
,
pTable
->
superTableI
d
);
mError
(
"ctable:%s, stable:%
"
PRIu64
" not exist"
,
pTable
->
info
.
tableId
,
pTable
->
sui
d
);
pTable
->
vgId
=
0
;
SSdbOper
desc
=
{
0
};
desc
.
type
=
SDB_OPER_LOCAL
;
...
...
@@ -560,6 +561,22 @@ static void *mgmtGetSuperTable(char *tableId) {
return
sdbGetRow
(
tsSuperTableSdb
,
tableId
);
}
static
void
*
mgmtGetSuperTableByUid
(
uint64_t
uid
)
{
SSuperTableObj
*
pStable
=
NULL
;
void
*
pNode
=
NULL
;
while
(
1
)
{
pNode
=
mgmtGetNextSuperTable
(
pNode
,
&
pStable
);
if
(
pStable
==
NULL
)
break
;
if
(
pStable
->
uid
==
uid
)
{
return
pStable
;
}
mgmtDecTableRef
(
pStable
);
}
return
NULL
;
}
void
*
mgmtGetTable
(
char
*
tableId
)
{
void
*
pTable
=
mgmtGetSuperTable
(
tableId
);
if
(
pTable
!=
NULL
)
{
...
...
@@ -1358,8 +1375,8 @@ static SChildTableObj* mgmtDoCreateChildTable(SCMCreateTableMsg *pCreate, SVgObj
}
mgmtDecTableRef
(
pSuperTable
);
strcpy
(
pTable
->
superTableId
,
pSuperTable
->
info
.
tableId
)
;
pTable
->
uid
=
(((
uint64_t
)
pTable
->
vgId
)
<<
40
)
+
((((
uint64_t
)
pTable
->
sid
)
&
((
1ul
<<
24
)
-
1ul
))
<<
16
)
+
pTable
->
suid
=
pSuperTable
->
uid
;
pTable
->
uid
=
(((
uint64_t
)
pTable
->
vgId
)
<<
40
)
+
((((
uint64_t
)
pTable
->
sid
)
&
((
1ul
<<
24
)
-
1ul
))
<<
16
)
+
(
sdbGetVersion
()
&
((
1ul
<<
16
)
-
1ul
));
pTable
->
superTable
=
pSuperTable
;
}
else
{
...
...
@@ -2073,7 +2090,7 @@ static int32_t mgmtRetrieveShowTables(SShowObj *pShow, char *data, int32_t rows,
pWrite
=
data
+
pShow
->
offset
[
cols
]
*
rows
+
pShow
->
bytes
[
cols
]
*
numOfRows
;
if
(
pTable
->
info
.
type
==
TSDB_CHILD_TABLE
)
{
mgmtExtractTableName
(
pTable
->
superTableId
,
pWrite
);
mgmtExtractTableName
(
pTable
->
superTable
->
info
.
table
Id
,
pWrite
);
}
cols
++
;
...
...
tests/script/unique/cluster/backup/balance4.sim
已删除
100644 → 0
浏览文件 @
625deb01
system sh/stop_dnodes.sh
sleep 1000
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/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode5 -i 5
system sh/deploy.sh -n dnode6 -i 6
system sh/deploy.sh -n dnode7 -i 7
system sh/deploy.sh -n dnode8 -i 8
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 4
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 statusInterval -v 1
system sh/cfg.sh -n dnode2 -c statusInterval -v 1
system sh/cfg.sh -n dnode3 -c statusInterval -v 1
system sh/cfg.sh -n dnode4 -c statusInterval -v 1
system sh/cfg.sh -n dnode5 -c statusInterval -v 1
system sh/cfg.sh -n dnode6 -c statusInterval -v 1
system sh/cfg.sh -n dnode7 -c statusInterval -v 1
system sh/cfg.sh -n dnode8 -c statusInterval -v 1
system sh/cfg.sh -n dnode1 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode2 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode3 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode4 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode5 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode6 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode7 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode8 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode1 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode2 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode3 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode4 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode5 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode6 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode7 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode8 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode1 -c commitLog -v 0
system sh/cfg.sh -n dnode2 -c commitLog -v 0
system sh/cfg.sh -n dnode3 -c commitLog -v 0
system sh/cfg.sh -n dnode4 -c commitLog -v 0
system sh/cfg.sh -n dnode5 -c commitLog -v 0
system sh/cfg.sh -n dnode6 -c commitLog -v 0
system sh/cfg.sh -n dnode7 -c commitLog -v 0
system sh/cfg.sh -n dnode8 -c commitLog -v 0
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode4 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode5 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode6 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode7 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode8 -c mgmtEqualVnodeNum -v 0
print ============== step1
print ========= start dnode1
system sh/exec.sh -n dnode1 -s start
$x = 0
connectTbase:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql connect -x connectTbase
sql create dnode $hostname2
sql create dnode $hostname3
sql create dnode $hostname4
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode4 -s start
sleep 4001
$x = 0
created1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create database c_b4_d1 replica 4 -x created1
sql use c_b4_d1
$x = 0
create1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table c_b4_t1 (t timestamp, i int) -x create1
sql insert into c_b4_t1 values(now+1s, 15)
sql insert into c_b4_t1 values(now+2s, 14)
sql insert into c_b4_t1 values(now+2s, 13)
sql insert into c_b4_t1 values(now+3s, 12)
sql insert into c_b4_t1 values(now+4s, 11)
sql create database c_b4_d2 replica 4
sql use c_b4_d2
$x = 0
create2:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table c_b4_t2 (t timestamp, i int) -x create2
sql insert into c_b4_t2 values(now+1s, 25)
sql insert into c_b4_t2 values(now+2s, 24)
sql insert into c_b4_t2 values(now+3s, 23)
sql insert into c_b4_t2 values(now+4s, 22)
sql insert into c_b4_t2 values(now+5s, 21)
sql create database c_b4_d3 replica 4
sql use c_b4_d3
$x = 0
create3:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table c_b4_t3 (t timestamp, i int) -x create3
sql insert into c_b4_t3 values(now+1s, 35)
sql insert into c_b4_t3 values(now+2s, 34)
sql insert into c_b4_t3 values(now+3s, 33)
sql insert into c_b4_t3 values(now+4s, 32)
sql insert into c_b4_t3 values(now+5s, 31)
$x = 0
show1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show1
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
if $dnode1Vnodes != 1 then
goto show1
endi
if $dnode2Vnodes != 1 then
goto show1
endi
if $dnode3Vnodes != 1 then
goto show1
endi
if $dnode4Vnodes != 1 then
goto show1
endi
if $dnode5Vnodes != null then
goto show1
endi
print ============================== step2
print ========= start dnode5
sql create dnode $hostname5
system sh/exec.sh -n dnode5 -s start
sleep 9000
$x = 0
show2:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show2
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
if $dnode5Vnodes != 2 then
goto show2
endi
print ============================== step3
print ========= drop dnode2
sql drop dnode $hostname2
sleep 9000
$x = 0
show3:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show3
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
if $dnode1Vnodes != 1 then
goto show3
endi
if $dnode2Vnodes != null then
goto show3
endi
if $dnode3Vnodes != 1 then
goto show3
endi
if $dnode4Vnodes != 1 then
goto show3
endi
if $dnode5Vnodes != 1 then
goto show3
endi
system sh/exec.sh -n dnode2 -s stop
print ============================== step4
print ========= start dnode2
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
sleep 10000
$x = 0
show4:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show4
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
if $dnode2Vnodes != 2 then
goto show4
endi
print ============================== step5
print ========= drop dnode3
sql drop dnode $hostname3
sleep 9000
$x = 0
show5:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show5
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
if $dnode1Vnodes != 1 then
goto show5
endi
if $dnode2Vnodes != 1 then
goto show5
endi
if $dnode3Vnodes != null then
goto show5
endi
if $dnode4Vnodes != 1 then
goto show5
endi
if $dnode5Vnodes != 1 then
goto show5
endi
system sh/exec.sh -n dnode3 -s stop
print ============================== step6
print ========= start dnode3
sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
sleep 9000
$x = 0
show6:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show6
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
if $dnode3Vnodes != 2 then
goto show6
endi
print ============================== step7
print ========= drop dnode4
sql drop dnode $hostname4
sleep 9000
$x = 0
show7:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show7
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
if $dnode1Vnodes != 1 then
goto show7
endi
if $dnode2Vnodes != 1 then
goto show7
endi
if $dnode3Vnodes != 1 then
goto show7
endi
if $dnode4Vnodes != null then
goto show7
endi
if $dnode5Vnodes != 1 then
goto show7
endi
system sh/exec.sh -n dnode4 -s stop
print ============================== step8
print ========= start dnode4
sql create dnode $hostname4
system sh/exec.sh -n dnode4 -s start
sleep 9000
$x = 0
show8:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show8
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
if $dnode4Vnodes != 2 then
goto show8
endi
print ============================== step9
print ========= drop dnode5
sql drop dnode $hostname5
sleep 9000
$x = 0
show9:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show9
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
if $dnode1Vnodes != 1 then
goto show9
endi
if $dnode2Vnodes != 1 then
goto show9
endi
if $dnode3Vnodes != 1 then
goto show9
endi
if $dnode4Vnodes != 1 then
goto show9
endi
if $dnode5Vnodes != null then
goto show9
endi
system sh/exec.sh -n dnode5 -s stop
print ============================== step10
print ========= start dnode5
sql create dnode $hostname5
system sh/exec.sh -n dnode5 -s start
sleep 9000
$x = 0
show10:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show10
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
if $dnode5Vnodes != 2 then
goto show10
endi
print ============================== step11
print ========= drop dnode1
system sh/exec.sh -n dnode1 -s stop
print stop dnode1 and sleep 10000
sleep 10000
sql drop dnode $hostname1
print drop dnode1 and sleep 9000
sleep 9000
$x = 0
show11:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show11
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
if $dnode1Vnodes != null then
goto show11
endi
if $dnode2Vnodes != 1 then
goto show11
endi
if $dnode3Vnodes != 1 then
goto show11
endi
if $dnode4Vnodes != 1 then
goto show11
endi
if $dnode5Vnodes != 1 then
goto show11
endi
print ============================== step12
print ========= start dnode1
sql create dnode $hostname1
system sh/exec.sh -n dnode1 -s start
sleep 12000
$x = 0
show12:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show12
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
if $dnode1Vnodes != 2 then
goto show12
endi
print ============================== step13
print ========= add db4
sql create database c_b4_d4 replica 4
sql use c_b4_d4
$x = 0
create4:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table c_b4_t4 (t timestamp, i int) -x create4
sql insert into c_b4_t4 values(now+1s, 45)
sql insert into c_b4_t4 values(now+2s, 44)
sql insert into c_b4_t4 values(now+3s, 43)
sql insert into c_b4_t4 values(now+4s, 42)
sql insert into c_b4_t4 values(now+5s, 41)
sql create database c_b4_d5 replica 4
sql use c_b4_d5;
$x = 0
create5:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table c_b4_t5 (t timestamp, i int) -x create5
sql insert into c_b4_t5 values(now+1s, 55)
sql insert into c_b4_t5 values(now+2s, 54)
sql insert into c_b4_t5 values(now+3s, 53)
sql insert into c_b4_t5 values(now+4s, 52)
sql insert into c_b4_t5 values(now+5s, 51)
$x = 0
show13:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show13
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
if $dnode1Vnodes != 0 then
goto show13
endi
if $dnode2Vnodes != 0 then
goto show13
endi
if $dnode3Vnodes != 0 then
goto show13
endi
if $dnode4Vnodes != 0 then
goto show13
endi
if $dnode4Vnodes != 0 then
goto show13
endi
print ============================== step14
print ========= check data
sql use c_b4_d1
sql select * from c_b4_t1
print $data01 $data11 $data21 $data31 $data41
if $data01 != 11 then
return -1
endi
if $data11 != 12 then
return -1
endi
if $data21 != 13 then
return -1
endi
if $data31 != 14 then
return -1
endi
if $data41 != 15 then
return -1
endi
sql use c_b4_d2
sql select * from c_b4_t2
print $data01 $data11 $data21 $data31 $data41
if $data01 != 21 then
return -1
endi
if $data11 != 22 then
return -1
endi
if $data21 != 23 then
return -1
endi
if $data31 != 24 then
return -1
endi
if $data41 != 25 then
return -1
endi
sql use c_b4_d3
sql select * from c_b4_t3
print $data01 $data11 $data21 $data31 $data41
if $data01 != 31 then
return -1
endi
if $data11 != 32 then
return -1
endi
if $data21 != 33 then
return -1
endi
if $data31 != 34 then
return -1
endi
if $data41 != 35 then
return -1
endi
sql use c_b4_d4
sql select * from c_b4_t4
print $data01 $data11 $data21 $data31 $data41
if $data01 != 41 then
return -1
endi
if $data11 != 42 then
return -1
endi
if $data21 != 43 then
return -1
endi
if $data31 != 44 then
return -1
endi
if $data41 != 45 then
return -1
endi
sql use c_b4_d5
sql select * from c_b4_t5
print $data01 $data11 $data21 $data31 $data41
if $data01 != 51 then
return -1
endi
if $data11 != 52 then
return -1
endi
if $data21 != 53 then
return -1
endi
if $data31 != 54 then
return -1
endi
if $data41 != 55 then
return -1
endi
print ============================================ over
system sh/exec.sh -n dnode1 -s stop
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode3 -s stop
system sh/exec.sh -n dnode4 -s stop
system sh/exec.sh -n dnode5 -s stop
system sh/exec.sh -n dnode6 -s stop
system sh/exec.sh -n dnode7 -s stop
system sh/exec.sh -n dnode8 -s stop
tests/script/unique/cluster/backup/balance5.sim
已删除
100644 → 0
浏览文件 @
625deb01
system sh/stop_dnodes.sh
sleep 1000
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/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode5 -i 5
system sh/deploy.sh -n dnode6 -i 6
system sh/deploy.sh -n dnode7 -i 7
system sh/deploy.sh -n dnode8 -i 8
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 4
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 statusInterval -v 1
system sh/cfg.sh -n dnode2 -c statusInterval -v 1
system sh/cfg.sh -n dnode3 -c statusInterval -v 1
system sh/cfg.sh -n dnode4 -c statusInterval -v 1
system sh/cfg.sh -n dnode5 -c statusInterval -v 1
system sh/cfg.sh -n dnode6 -c statusInterval -v 1
system sh/cfg.sh -n dnode7 -c statusInterval -v 1
system sh/cfg.sh -n dnode8 -c statusInterval -v 1
system sh/cfg.sh -n dnode1 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode2 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode3 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode4 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode5 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode6 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode7 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode8 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode1 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode2 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode3 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode4 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode5 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode6 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode7 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode8 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode1 -c commitLog -v 0
system sh/cfg.sh -n dnode2 -c commitLog -v 0
system sh/cfg.sh -n dnode3 -c commitLog -v 0
system sh/cfg.sh -n dnode4 -c commitLog -v 0
system sh/cfg.sh -n dnode5 -c commitLog -v 0
system sh/cfg.sh -n dnode6 -c commitLog -v 0
system sh/cfg.sh -n dnode7 -c commitLog -v 0
system sh/cfg.sh -n dnode8 -c commitLog -v 0
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode4 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode5 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode6 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode7 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode8 -c mgmtEqualVnodeNum -v 0
print ============== step1
print ========= start dnode1
system sh/exec.sh -n dnode1 -s start
$x = 0
connectTbase:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql connect -x connectTbase
sql create dnode $hostname2
sql create dnode $hostname3
sql create dnode $hostname4
sql create dnode $hostname5
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode4 -s start
system sh/exec.sh -n dnode5 -s start
sleep 4001
$x = 0
created1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create database c_b5_d1 replica 5 -x created1
sql use c_b5_d1
$x = 0
create1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table c_b5_t1 (t timestamp, i int) -x create1
sql insert into c_b5_t1 values(now+1s, 15)
sql insert into c_b5_t1 values(now+2s, 14)
sql insert into c_b5_t1 values(now+2s, 13)
sql insert into c_b5_t1 values(now+3s, 12)
sql insert into c_b5_t1 values(now+4s, 11)
sql create database c_b5_d2 replica 5
sql use c_b5_d2
$x = 0
create2:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table c_b5_t2 (t timestamp, i int) -x create2
sql insert into c_b5_t2 values(now+1s, 25)
sql insert into c_b5_t2 values(now+2s, 24)
sql insert into c_b5_t2 values(now+3s, 23)
sql insert into c_b5_t2 values(now+4s, 22)
sql insert into c_b5_t2 values(now+5s, 21)
show1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show1
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
if $dnode1Vnodes != 2 then
goto show1
endi
if $dnode2Vnodes != 2 then
goto show1
endi
if $dnode3Vnodes != 2 then
goto show1
endi
if $dnode4Vnodes != 2 then
goto show1
endi
if $dnode5Vnodes != 2 then
goto show1
endi
print ============================== step2
print ========= start dnode6
sql create dnode $hostname6
system sh/exec.sh -n dnode6 -s start
sql create database c_b5_d3 replica 5
sql use c_b5_d3
$x = 0
create3:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table c_b5_t3 (t timestamp, i int) -x create3
sql insert into c_b5_t3 values(now+1s, 35)
sql insert into c_b5_t3 values(now+2s, 34)
sql insert into c_b5_t3 values(now+3s, 33)
sql insert into c_b5_t3 values(now+4s, 32)
sql insert into c_b5_t3 values(now+5s, 31)
sleep 10000
show2:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show2
$dnode1Status = $data4_192.168.0.1
print dnode1 $dnode1Status
$dnode2Status = $data4_192.168.0.2
print dnode2 $dnode2Status
$dnode3Status = $data4_192.168.0.3
print dnode3 $dnode3Status
$dnode4Status = $data4_192.168.0.4
print dnode4 $dnode4Status
$dnode5Status = $data4_192.168.0.5
print dnode5 $dnode5Status
$dnode6Status = $data4_192.168.0.6
print dnode6 $dnode6Status
if $dnode1Status != online then
goto show2
endi
if $dnode2Status != online then
goto show2
endi
if $dnode3Status != online then
goto show2
endi
if $dnode4Status != online then
goto show2
endi
if $dnode5Status != online then
goto show2
endi
if $dnode6Status != online then
goto show2
endi
print ============================== step3
print ========= drop dnode1
system sh/exec.sh -n dnode1 -s stop
print stop dnode1 and sleep 10000
sleep 10000
sql drop dnode $hostname1
print drop dnode1 and sleep 9000
sleep 9000
show3:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show3
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
$dnode6Vnodes = $data3_192.168.0.6
print dnode6 $dnode6Vnodes
if $dnode1Vnodes != null then
goto show3
endi
if $dnode2Vnodes != 1 then
goto show3
endi
if $dnode3Vnodes != 1 then
goto show3
endi
if $dnode4Vnodes != 1 then
goto show3
endi
if $dnode5Vnodes != 1 then
goto show3
endi
if $dnode6Vnodes != 1 then
goto show3
endi
print ============================== step4
print ========= add db, start dnode7
sql create database c_b5_d4 replica 5
sql use c_b5_d4
$x = 0
create4:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table c_b5_t4 (t timestamp, i int) -x create4
$x = 0
insert4:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql insert into c_b5_t4 values(now+1s, 45) -x insert4
sql insert into c_b5_t4 values(now+2s, 44)
sql insert into c_b5_t4 values(now+3s, 43)
sql insert into c_b5_t4 values(now+4s, 42)
sql insert into c_b5_t4 values(now+5s, 41)
sql create dnode $hostname1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql create dnode $hostname7
system sh/exec.sh -n dnode7 -s start
sql create dnode $hostname8
system sh/exec.sh -n dnode8 -s start
sleep 9000
print ============================== step5
print ========= check data
sql use c_b5_d1
sql select * from c_b5_t1
print $data01 $data11 $data21 $data31 $data41
if $data01 != 11 then
return -1
endi
if $data11 != 12 then
return -1
endi
if $data21 != 13 then
return -1
endi
if $data31 != 14 then
return -1
endi
if $data41 != 15 then
return -1
endi
sql use c_b5_d2
sql select * from c_b5_t2
print $data01 $data11 $data21 $data31 $data41
if $data01 != 21 then
return -1
endi
if $data11 != 22 then
return -1
endi
if $data21 != 23 then
return -1
endi
if $data31 != 24 then
return -1
endi
if $data41 != 25 then
return -1
endi
sql use c_b5_d3
sql select * from c_b5_t3
print $data01 $data11 $data21 $data31 $data41
if $data01 != 31 then
return -1
endi
if $data11 != 32 then
return -1
endi
if $data21 != 33 then
return -1
endi
if $data31 != 34 then
return -1
endi
if $data41 != 35 then
return -1
endi
sql use c_b5_d4
sql select * from c_b5_t4
print $data01 $data11 $data21 $data31 $data41
if $data01 != 41 then
return -1
endi
if $data11 != 42 then
return -1
endi
if $data21 != 43 then
return -1
endi
if $data31 != 44 then
return -1
endi
if $data41 != 45 then
return -1
endi
print ============================================ over
system sh/exec.sh -n dnode1 -s stop
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode3 -s stop
system sh/exec.sh -n dnode4 -s stop
system sh/exec.sh -n dnode5 -s stop
system sh/exec.sh -n dnode6 -s stop
system sh/exec.sh -n dnode7 -s stop
system sh/exec.sh -n dnode8 -s stop
tests/script/unique/cluster/backup/balancex.sim
已删除
100644 → 0
浏览文件 @
625deb01
sleep 1000
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/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode5 -i 5
system sh/deploy.sh -n dnode6 -i 6
system sh/deploy.sh -n dnode7 -i 7
system sh/deploy.sh -n dnode8 -i 8
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 4
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 statusInterval -v 1
system sh/cfg.sh -n dnode2 -c statusInterval -v 1
system sh/cfg.sh -n dnode3 -c statusInterval -v 1
system sh/cfg.sh -n dnode4 -c statusInterval -v 1
system sh/cfg.sh -n dnode5 -c statusInterval -v 1
system sh/cfg.sh -n dnode6 -c statusInterval -v 1
system sh/cfg.sh -n dnode7 -c statusInterval -v 1
system sh/cfg.sh -n dnode8 -c statusInterval -v 1
system sh/cfg.sh -n dnode1 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode2 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode3 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode4 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode5 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode6 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode7 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode8 -c balanceMonitorInterval -v 1
system sh/cfg.sh -n dnode1 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode2 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode3 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode4 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode5 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode6 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode7 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode8 -c balanceStartInterval -v 10
system sh/cfg.sh -n dnode1 -c commitLog -v 1
system sh/cfg.sh -n dnode2 -c commitLog -v 1
system sh/cfg.sh -n dnode3 -c commitLog -v 1
system sh/cfg.sh -n dnode4 -c commitLog -v 1
system sh/cfg.sh -n dnode5 -c commitLog -v 1
system sh/cfg.sh -n dnode6 -c commitLog -v 1
system sh/cfg.sh -n dnode7 -c commitLog -v 1
system sh/cfg.sh -n dnode8 -c commitLog -v 1
system sh/cfg.sh -n dnode1 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode2 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode3 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode4 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode5 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode6 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode7 -c mgmtEqualVnodeNum -v 0
system sh/cfg.sh -n dnode8 -c mgmtEqualVnodeNum -v 0
print ============== step1
print ========= start dnode1
system sh/exec.sh -n dnode1 -s start
$x = 0
connectTbase:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql connect -x connectTbase
sql create dnode $hostname2
sql create dnode $hostname3
sql create dnode $hostname4
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec.sh -n dnode4 -s start
sleep 4001
sql connect
$x = 0
created1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create database c_bx_d1 replica 4 -x created1
sql use c_bx_d1
$x = 0
create1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table c_bx_t1 (t timestamp, i int) -x create1
sql insert into c_bx_t1 values(now+1s, 15)
sql insert into c_bx_t1 values(now+2s, 14)
sql insert into c_bx_t1 values(now+2s, 13)
sql insert into c_bx_t1 values(now+3s, 12)
sql insert into c_bx_t1 values(now+4s, 11)
sql create database c_bx_d2 replica 4
sql use c_bx_d2
$x = 0
create2:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table c_bx_t2 (t timestamp, i int) -x create2
sql insert into c_bx_t2 values(now+1s, 25)
sql insert into c_bx_t2 values(now+2s, 24)
sql insert into c_bx_t2 values(now+3s, 23)
sql insert into c_bx_t2 values(now+4s, 22)
sql insert into c_bx_t2 values(now+5s, 21)
show1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show1
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
if $dnode1Vnodes != 2 then
goto show1
endi
if $dnode2Vnodes != 2 then
goto show1
endi
if $dnode3Vnodes != 2 then
goto show1
endi
if $dnode4Vnodes != 2 then
goto show1
endi
print ============================== step2
print ========= start dnode6
sql create database c_bx_d3 replica 4
sql use c_bx_d3
$x = 0
create3:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table c_bx_t3 (t timestamp, i int) -x create3
sql insert into c_bx_t3 values(now+1s, 35)
sql insert into c_bx_t3 values(now+2s, 34)
sql insert into c_bx_t3 values(now+3s, 33)
sql insert into c_bx_t3 values(now+4s, 32)
sql insert into c_bx_t3 values(now+5s, 31)
sql create dnode $hostname5
system sh/exec.sh -n dnode5 -s start
sleep 9000
show2:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show2
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
$dnode6Vnodes = $data3_192.168.0.6
print dnode6 $dnode6Vnodes
if $dnode5Vnodes != 2 then
goto show2
endi
print ============================== step3
print ========= drop dnode1
system sh/exec.sh -n dnode1 -s stop -x SIGINT
print stop dnode1 and sleep 10000
sleep 10000
sql drop dnode $hostname1
print drop dnode1 and sleep 9000
sleep 9000
show3:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show dnodes -x show3
$dnode1Vnodes = $data3_192.168.0.1
print dnode1 $dnode1Vnodes
$dnode2Vnodes = $data3_192.168.0.2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data3_192.168.0.3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data3_192.168.0.4
print dnode4 $dnode4Vnodes
$dnode5Vnodes = $data3_192.168.0.5
print dnode5 $dnode5Vnodes
$dnode6Vnodes = $data3_192.168.0.6
print dnode6 $dnode6Vnodes
if $dnode1Vnodes != null then
goto show3
endi
if $dnode2Vnodes != 1 then
goto show3
endi
if $dnode3Vnodes != 1 then
goto show3
endi
if $dnode4Vnodes != 1 then
goto show3
endi
if $dnode5Vnodes != 1 then
goto show3
endi
print ============================== step4
print ========= add db, start dnode7
sql create database c_bx_d4 replica 4
sql use c_bx_d4
$x = 0
create4:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table c_bx_t4 (t timestamp, i int) -x create4
sql insert into c_bx_t4 values(now+1s, 45)
sql insert into c_bx_t4 values(now+2s, 44)
sql insert into c_bx_t4 values(now+3s, 43)
sql insert into c_bx_t4 values(now+4s, 42)
sql insert into c_bx_t4 values(now+5s, 41)
print ============================== step5
print ========= check data
sql use c_bx_d1
sql select * from c_bx_d1
print $data01 $data11 $data21 $data31 $data41
if $data01 != 11 then
return -1
endi
if $data11 != 12 then
return -1
endi
if $data21 != 13 then
return -1
endi
if $data31 != 14 then
return -1
endi
if $data41 != 15 then
return -1
endi
sql use c_bx_d2
sql select * from c_bx_d2
print $data01 $data11 $data21 $data31 $data41
if $data01 != 21 then
return -1
endi
if $data11 != 22 then
return -1
endi
if $data21 != 23 then
return -1
endi
if $data31 != 24 then
return -1
endi
if $data41 != 25 then
return -1
endi
sql use c_bx_d3
sql select * from c_bx_d3
print $data01 $data11 $data21 $data31 $data41
if $data01 != 31 then
return -1
endi
if $data11 != 32 then
return -1
endi
if $data21 != 33 then
return -1
endi
if $data31 != 34 then
return -1
endi
if $data41 != 35 then
return -1
endi
sql use c_bx_d4
sql select * from c_bx_d4
print $data01 $data11 $data21 $data31 $data41
if $data01 != 41 then
return -1
endi
if $data11 != 42 then
return -1
endi
if $data21 != 43 then
return -1
endi
if $data31 != 44 then
return -1
endi
if $data41 != 45 then
return -1
endi
print ============================================ over
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
tests/script/unique/cluster/testSuite.sim
浏览文件 @
baaa1ecf
run unique/unique/balance1.sim
run unique/unique/balance2.sim
run unique/unique/balance3.sim
run unique/unique/balance1_bug.sim
run unique/unique/balance1_single.sim
\ No newline at end of file
#run unique/unique/balance1.sim
#run unique/unique/balance2.sim
#run unique/unique/balance3.sim
#run unique/unique/balance1_bug.sim
#run unique/unique/balance1_single.sim
\ No newline at end of file
tests/script/unique/column/replica3.sim
浏览文件 @
baaa1ecf
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 c
ommitLog -v 0
system sh/cfg.sh -n dnode2 -c c
ommitLog -v 0
system sh/cfg.sh -n dnode3 -c c
ommitLog -v 0
system sh/cfg.sh -n dnode1 -c c
log -v 2
system sh/cfg.sh -n dnode2 -c c
log -v 2
system sh/cfg.sh -n dnode3 -c c
log -v 2
system sh/cfg.sh -n dnode1 -c numofMpeers -v 3
system sh/cfg.sh -n dnode2 -c numofMpeers -v 3
system sh/cfg.sh -n dnode3 -c numofMpeers -v 3
system sh/exec.sh -n dnode1 -s start
system sh/exec
_up
.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
sql create dnode $hostname3
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
system sh/exec
_up
.sh -n dnode2 -s start
system sh/exec
_up
.sh -n dnode3 -s start
sql create database db replica 3
sql use db
sql create table mt (ts timestamp, f1 float, f2 float, f3 float, f4 float, f5 float, f6 float, f7 float, f8 float, f9 float, f10 float) tags (t1 int, t2 int)
sql create table
tb1 using
mt tags(1, 2)
sql create table
db.
mt (ts timestamp, f1 float, f2 float, f3 float, f4 float, f5 float, f6 float, f7 float, f8 float, f9 float, f10 float) tags (t1 int, t2 int)
sql create table
db.tb1 using db.
mt tags(1, 2)
sleep 3001
$x = 1000
while $x <
200
0
while $x <
101
0
sql insert into tb1 values (now+1s , $x , $x , $x , $x , $x , $x , $x , $x , $x , $x )
$x = $x + 1
endw
system sh/exec.sh -n dnode1 -s stop
system sh/exec.sh -n dnode2 -s stop
system sh/exec.sh -n dnode3 -s stop
system sh/exec_up.sh -n dnode1 -s stop
system sh/exec_up.sh -n dnode2 -s stop
system sh/exec_up.sh -n dnode3 -s stop
tests/script/unique/column/testSuite.sim
浏览文件 @
baaa1ecf
run unique/column/replica3.sim
#
run unique/column/replica3.sim
tests/script/unique/db/replica_add13.sim
浏览文件 @
baaa1ecf
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
...
...
@@ -93,24 +89,24 @@ show3:
endi
sql show dnodes
print dnode1 ==> openVnodes: $data
3
_1
print dnode2 ==> openVnodes: $data
3
_2
print dnode3 ==> openVnodes: $data
3
_3
print dnode4 ==> openVnodes: $data
3
_4
print dnode1 ==> openVnodes: $data
2
_1
print dnode2 ==> openVnodes: $data
2
_2
print dnode3 ==> openVnodes: $data
2
_3
print dnode4 ==> openVnodes: $data
2
_4
if $data
3
_1 != 0 then
if $data
2
_1 != 0 then
return -1
endi
if $data
3
_2 != 4 then
if $data
2
_2 != 4 then
return -1
endi
if $data
3
_3 != 4 then
if $data
2
_3 != 4 then
return -1
endi
if $data
3
_3 != 4 then
if $data
2
_3 != 4 then
return -1
endi
...
...
tests/script/unique/db/replica_add23.sim
浏览文件 @
baaa1ecf
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
...
...
@@ -93,24 +89,24 @@ show3:
endi
sql show dnodes
print dnode1 ==> openVnodes: $data
3
_1
print dnode2 ==> openVnodes: $data
3
_2
print dnode3 ==> openVnodes: $data
3
_3
print dnode4 ==> openVnodes: $data
3
_4
print dnode1 ==> openVnodes: $data
2
_1
print dnode2 ==> openVnodes: $data
2
_2
print dnode3 ==> openVnodes: $data
2
_3
print dnode4 ==> openVnodes: $data
2
_4
if $data
3
_1 != 0 then
if $data
2
_1 != 0 then
return -1
endi
if $data
3
_2 != 4 then
if $data
2
_2 != 4 then
return -1
endi
if $data
3
_3 != 4 then
if $data
2
_3 != 4 then
return -1
endi
if $data
3
_3 != 4 then
if $data
2
_3 != 4 then
return -1
endi
...
...
tests/script/unique/db/replica_part.sim
浏览文件 @
baaa1ecf
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
...
...
tests/script/unique/db/replica_reduce21.sim
浏览文件 @
baaa1ecf
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
...
...
tests/script/unique/db/replica_reduce31.sim
浏览文件 @
baaa1ecf
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
...
...
tests/script/unique/db/replica_reduce32.sim
浏览文件 @
baaa1ecf
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
...
...
@@ -97,34 +95,26 @@ if $rows != 2 then
return -1
endi
sql reset query cache
sleep 1000
print ========= step4
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(now, 3) -x step1
step1:
sql insert into d2.t2 values(now, 3) -x step2
step2:
sql insert into d3.t3 values(now, 3) -x step3
step3:
sql insert into d4.t4 values(now, 3) -x step4
step4:
sql select * from d1.t1
if $rows != 3 then
return -1
endi
sql select * from d2.t2
if $rows != 3 then
return -1
endi
sql select * from d3.t3
if $rows != 3 then
return -1
endi
sql select * from d4.t4
if $rows != 3 then
return -1
endi
print ========= step5
system sh/exec_up.sh -n dnode2 -s start
...
...
@@ -136,16 +126,18 @@ sleep 5000
sql reset query cache
sleep 1000
sql_error insert into d1.t1 values(now, 4)
sql_error insert into d2.t2 values(now, 4)
sql_error insert into d3.t3 values(now, 4)
sql_error insert into d4.t4 values(now, 4)
sql insert into d1.t1 values(now, 3) -x step11
step11:
sql insert into d2.t2 values(now, 3) -x step21
step21:
sql insert into d3.t3 values(now, 3) -x step31
step31:
sql insert into d4.t4 values(now, 3) -x step41
step41:
print ========= step6
system sh/exec_up.sh -n dnode3 -s start
sleep 5000
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
sleep 3000
sql insert into d1.t1 values(now, 5)
sql insert into d2.t2 values(now, 5)
...
...
@@ -153,21 +145,13 @@ sql insert into d3.t3 values(now, 5)
sql insert into d4.t4 values(now, 5)
sql select * from d1.t1
if $rows != 4 then
return -1
endi
print d1.t1 $rows
sql select * from d2.t2
if $rows != 4 then
return -1
endi
print d2.t2 $rows
sql select * from d3.t3
if $rows != 4 then
return -1
endi
print d3.t3 $rows
sql select * from d4.t4
if $rows != 4 then
return -1
endi
print d4.t4 $rows
tests/script/unique/metrics/testSuite.sim
浏览文件 @
baaa1ecf
run unique/metrics/disk.sim
run unique/metrics/metrics.sim
run unique/metrics/values.sim
run unique/metrics/vnode3.sim
\ No newline at end of file
#run unique/metrics/disk.sim
#run unique/metrics/metrics.sim
#run unique/metrics/values.sim
#run unique/metrics/vnode3.sim
\ No newline at end of file
tests/script/unique/mnode/mgmt33.sim
浏览文件 @
baaa1ecf
...
...
@@ -8,7 +8,7 @@ system sh/cfg.sh -n dnode2 -c numOfMPeers -v 3
system sh/cfg.sh -n dnode3 -c numOfMPeers -v 3
print ============== step1
system sh/exec_up.sh -n dnode1 -s start
-t
system sh/exec_up.sh -n dnode1 -s start
sql connect
sql show mnodes
...
...
@@ -26,7 +26,7 @@ if $data3_3 != null then
endi
print ============== step2
system sh/exec_up.sh -n dnode2 -s start
-t
system sh/exec_up.sh -n dnode2 -s start
sql create dnode $hostname2
sleep 8000
...
...
@@ -49,7 +49,7 @@ if $dnode3Role != null then
endi
print ============== step3
system sh/exec_up.sh -n dnode3 -s start
-t
system sh/exec_up.sh -n dnode3 -s start
sql create dnode $hostname3
sleep 8000
...
...
@@ -98,7 +98,7 @@ sleep 3000
system sh/deploy.sh -n dnode2 -i 2
system sh/cfg.sh -n dnode2 -c numOfMPeers -v 3
system sh/exec_up.sh -n dnode2 -s start
-t
system sh/exec_up.sh -n dnode2 -s start
print ============== step5
sql create dnode $hostname2
...
...
tests/script/unique/mnode/mgmt34.sim
浏览文件 @
baaa1ecf
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
...
...
@@ -204,7 +199,7 @@ sleep 8000
sql show mnodes
$dnode1Role = $data2_1
$dnode2Role = $data
3
_5
$dnode2Role = $data
2
_5
$dnode3Role = $data2_3
$dnode4Role = $data2_4
print dnode1 ==> $dnode1Role
...
...
tests/script/unique/mnode/testSuite.sim
浏览文件 @
baaa1ecf
...
...
@@ -5,5 +5,5 @@ run unique/mnode/mgmt25.sim
run unique/mnode/mgmt26.sim
run unique/mnode/mgmt33.sim
run unique/mnode/mgmt34.sim
run unique/mnode/mgmtr2.sim
run unique/mnode/secondIp.sim
#
run unique/mnode/mgmtr2.sim
#
run unique/mnode/secondIp.sim
tests/script/unique/stream/testSuite.sim
浏览文件 @
baaa1ecf
run unique/stream/table_replica1_dnode2.sim
run unique/stream/metrics_replica1_dnode2.sim
run unique/stream/table_replica2_dnode2.sim
run unique/stream/metrics_replica2_dnode2.sim
run unique/stream/table_replica2_dnode2_vnoden.sim
run unique/stream/metrics_replica2_dnode2_vnoden.sim
run unique/stream/table_replica2_dnode3.sim
run unique/stream/metrics_replica2_dnode3.sim
run unique/stream/table_replica3_dnode4.sim
run unique/stream/metrics_replica3_dnode4.sim
run unique/stream/table_vnode_stop.sim
run unique/stream/metrics_vnode_stop.sim
#run unique/stream/table_balance.sim
#run unique/stream/metrics_balance.sim
#run unique/stream/table_move.sim
\ No newline at end of file
#run unique/stream/table_replica1_dnode2.sim
#run unique/stream/metrics_replica1_dnode2.sim
#run unique/stream/table_replica2_dnode2.sim
#run unique/stream/metrics_replica2_dnode2.sim
#run unique/stream/table_replica2_dnode2_vnoden.sim
#run unique/stream/metrics_replica2_dnode2_vnoden.sim
#run unique/stream/table_replica2_dnode3.sim
#run unique/stream/metrics_replica2_dnode3.sim
#run unique/stream/table_replica3_dnode4.sim
#run unique/stream/metrics_replica3_dnode4.sim
#run unique/stream/table_vnode_stop.sim
#run unique/stream/metrics_vnode_stop.sim
##run unique/stream/table_balance.sim
##run unique/stream/metrics_balance.sim
##run unique/stream/table_move.sim
\ No newline at end of file
tests/script/unique/vnode/replica2_basic.sim
浏览文件 @
baaa1ecf
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 commitLog -v 0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录