Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
9f4a8ba7
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
9f4a8ba7
编写于
12月 24, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
12月 24, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4671 from taosdata/feature/sim
Feature/sim
上级
ee9b0063
1b11d6d9
变更
77
展开全部
隐藏空白更改
内联
并排
Showing
77 changed file
with
3046 addition
and
1178 deletion
+3046
-1178
src/balance/src/bnMain.c
src/balance/src/bnMain.c
+2
-1
src/balance/src/bnThread.c
src/balance/src/bnThread.c
+5
-1
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+2
-1
src/common/src/tglobal.c
src/common/src/tglobal.c
+14
-3
src/dnode/src/dnodeMain.c
src/dnode/src/dnodeMain.c
+1
-1
src/dnode/src/dnodeVRead.c
src/dnode/src/dnodeVRead.c
+3
-2
src/dnode/src/dnodeVWrite.c
src/dnode/src/dnodeVWrite.c
+1
-0
src/mnode/src/mnodeMnode.c
src/mnode/src/mnodeMnode.c
+23
-0
src/mnode/src/mnodeSdb.c
src/mnode/src/mnodeSdb.c
+2
-0
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+3
-3
src/os/inc/osSocket.h
src/os/inc/osSocket.h
+1
-0
src/os/src/detail/osSocket.c
src/os/src/detail/osSocket.c
+4
-0
src/os/src/windows/wSocket.c
src/os/src/windows/wSocket.c
+1
-0
src/sync/inc/syncInt.h
src/sync/inc/syncInt.h
+11
-9
src/sync/inc/syncTcp.h
src/sync/inc/syncTcp.h
+3
-3
src/sync/src/syncArbitrator.c
src/sync/src/syncArbitrator.c
+7
-7
src/sync/src/syncMain.c
src/sync/src/syncMain.c
+215
-93
src/sync/src/syncRestore.c
src/sync/src/syncRestore.c
+25
-9
src/sync/src/syncRetrieve.c
src/sync/src/syncRetrieve.c
+9
-3
src/sync/src/syncTcp.c
src/sync/src/syncTcp.c
+5
-5
src/util/src/tsocket.c
src/util/src/tsocket.c
+12
-0
src/vnode/src/vnodeCfg.c
src/vnode/src/vnodeCfg.c
+3
-2
src/vnode/src/vnodeMgmt.c
src/vnode/src/vnodeMgmt.c
+4
-1
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+9
-5
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+1
-1
tests/script/general/db/alter_tables_d2.sim
tests/script/general/db/alter_tables_d2.sim
+98
-18
tests/script/general/db/alter_tables_v1.sim
tests/script/general/db/alter_tables_v1.sim
+91
-16
tests/script/general/db/alter_tables_v4.sim
tests/script/general/db/alter_tables_v4.sim
+78
-13
tests/script/general/db/delete_reusevnode.sim
tests/script/general/db/delete_reusevnode.sim
+0
-2
tests/script/general/db/delete_writing1.sim
tests/script/general/db/delete_writing1.sim
+0
-1
tests/script/general/table/delete_writing.sim
tests/script/general/table/delete_writing.sim
+0
-2
tests/script/general/wal/sync.sim
tests/script/general/wal/sync.sim
+30
-9
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+1
-0
tests/script/jenkins/basic_3.txt
tests/script/jenkins/basic_3.txt
+32
-34
tests/script/jenkins/unique.txt
tests/script/jenkins/unique.txt
+2
-0
tests/script/sh/deploy.sh
tests/script/sh/deploy.sh
+2
-0
tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim
tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim
+4
-2
tests/script/unique/arbitrator/dn3_mn1_replica_change.sim
tests/script/unique/arbitrator/dn3_mn1_replica_change.sim
+160
-327
tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
...ipt/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
+8
-0
tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim
tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim
+5
-3
tests/script/unique/arbitrator/sync_replica3_alterTable_add.sim
...script/unique/arbitrator/sync_replica3_alterTable_add.sim
+3
-9
tests/script/unique/arbitrator/sync_replica_alterTable_background_add.sim
...que/arbitrator/sync_replica_alterTable_background_add.sim
+3
-0
tests/script/unique/big/balance.sim
tests/script/unique/big/balance.sim
+33
-22
tests/script/unique/big/tcp.sim
tests/script/unique/big/tcp.sim
+2
-3
tests/script/unique/cluster/balance1.sim
tests/script/unique/cluster/balance1.sim
+48
-23
tests/script/unique/cluster/balance2.sim
tests/script/unique/cluster/balance2.sim
+47
-15
tests/script/unique/cluster/balance3.sim
tests/script/unique/cluster/balance3.sim
+142
-92
tests/script/unique/cluster/vgroup100.sim
tests/script/unique/cluster/vgroup100.sim
+0
-5
tests/script/unique/db/delete.sim
tests/script/unique/db/delete.sim
+0
-5
tests/script/unique/db/delete_part.sim
tests/script/unique/db/delete_part.sim
+34
-17
tests/script/unique/db/replica_add12.sim
tests/script/unique/db/replica_add12.sim
+155
-48
tests/script/unique/db/replica_add13.sim
tests/script/unique/db/replica_add13.sim
+171
-27
tests/script/unique/db/replica_add23.sim
tests/script/unique/db/replica_add23.sim
+171
-27
tests/script/unique/db/replica_part.sim
tests/script/unique/db/replica_part.sim
+181
-31
tests/script/unique/db/replica_reduce21.sim
tests/script/unique/db/replica_reduce21.sim
+49
-16
tests/script/unique/db/replica_reduce31.sim
tests/script/unique/db/replica_reduce31.sim
+116
-21
tests/script/unique/db/replica_reduce32.sim
tests/script/unique/db/replica_reduce32.sim
+164
-28
tests/script/unique/dnode/balance1.sim
tests/script/unique/dnode/balance1.sim
+7
-9
tests/script/unique/dnode/balance2.sim
tests/script/unique/dnode/balance2.sim
+30
-11
tests/script/unique/dnode/balance3.sim
tests/script/unique/dnode/balance3.sim
+36
-14
tests/script/unique/dnode/offline3.sim
tests/script/unique/dnode/offline3.sim
+111
-0
tests/script/unique/dnode/reason.sim
tests/script/unique/dnode/reason.sim
+91
-20
tests/script/unique/dnode/remove1.sim
tests/script/unique/dnode/remove1.sim
+26
-10
tests/script/unique/dnode/remove2.sim
tests/script/unique/dnode/remove2.sim
+30
-7
tests/script/unique/dnode/vnode_clean.sim
tests/script/unique/dnode/vnode_clean.sim
+12
-14
tests/script/unique/import/replica2.sim
tests/script/unique/import/replica2.sim
+78
-10
tests/script/unique/import/replica3.sim
tests/script/unique/import/replica3.sim
+63
-7
tests/script/unique/mnode/mgmt20.sim
tests/script/unique/mnode/mgmt20.sim
+2
-3
tests/script/unique/mnode/mgmt22.sim
tests/script/unique/mnode/mgmt22.sim
+6
-8
tests/script/unique/mnode/mgmt23.sim
tests/script/unique/mnode/mgmt23.sim
+25
-16
tests/script/unique/mnode/mgmt33.sim
tests/script/unique/mnode/mgmt33.sim
+64
-26
tests/script/unique/mnode/mgmt34.sim
tests/script/unique/mnode/mgmt34.sim
+74
-35
tests/script/unique/mnode/mgmtr2.sim
tests/script/unique/mnode/mgmtr2.sim
+12
-9
tests/script/unique/vnode/many.sim
tests/script/unique/vnode/many.sim
+31
-1
tests/script/unique/vnode/replica2_repeat.sim
tests/script/unique/vnode/replica2_repeat.sim
+33
-2
tests/script/unique/vnode/replica3_basic.sim
tests/script/unique/vnode/replica3_basic.sim
+82
-8
tests/script/unique/vnode/replica3_repeat.sim
tests/script/unique/vnode/replica3_repeat.sim
+37
-2
未找到文件。
src/balance/src/bnMain.c
浏览文件 @
9f4a8ba7
...
...
@@ -330,7 +330,7 @@ void bnReset() {
tsAccessSquence
=
0
;
}
static
int32_t
bnMonitorVgroups
()
{
static
bool
bnMonitorVgroups
()
{
void
*
pIter
=
NULL
;
SVgObj
*
pVgroup
=
NULL
;
bool
hasUpdatingVgroup
=
false
;
...
...
@@ -489,6 +489,7 @@ void bnCheckStatus() {
mInfo
(
"dnode:%d, set to offline state, access seq:%d last seq:%d laststat:%d"
,
pDnode
->
dnodeId
,
tsAccessSquence
,
pDnode
->
lastAccess
,
pDnode
->
status
);
bnSetVgroupOffline
(
pDnode
);
bnStartTimer
(
3000
);
}
}
mnodeDecDnodeRef
(
pDnode
);
...
...
src/balance/src/bnThread.c
浏览文件 @
9f4a8ba7
...
...
@@ -31,7 +31,10 @@ static void *bnThreadFunc(void *arg) {
}
pthread_cond_wait
(
&
tsBnThread
.
cond
,
&
tsBnThread
.
mutex
);
mDebug
(
"balance thread wakes up to work"
);
bool
updateSoon
=
bnStart
();
mDebug
(
"balance thread finished this poll, updateSoon:%d"
,
updateSoon
);
bnStartTimer
(
updateSoon
?
1000
:
-
1
);
pthread_mutex_unlock
(
&
(
tsBnThread
.
mutex
));
}
...
...
@@ -101,8 +104,8 @@ static void bnProcessTimer(void *handle, void *tmrId) {
tsBnThread
.
timer
=
NULL
;
tsAccessSquence
++
;
bnCheckStatus
();
bnStartTimer
(
-
1
);
bnCheckStatus
();
if
(
handle
==
NULL
)
{
if
(
tsAccessSquence
%
tsBalanceInterval
==
0
)
{
...
...
@@ -121,6 +124,7 @@ void bnStartTimer(int64_t mseconds) {
bool
updateSoon
=
(
mseconds
!=
-
1
);
if
(
updateSoon
)
{
mTrace
(
"balance function will be called after %"
PRId64
" ms"
,
mseconds
);
taosTmrReset
(
bnProcessTimer
,
mseconds
,
(
void
*
)
mseconds
,
tsMnodeTmr
,
&
tsBnThread
.
timer
);
}
else
{
taosTmrReset
(
bnProcessTimer
,
tsStatusInterval
*
1000
,
NULL
,
tsMnodeTmr
,
&
tsBnThread
.
timer
);
...
...
src/common/inc/tglobal.h
浏览文件 @
9f4a8ba7
...
...
@@ -101,7 +101,8 @@ extern int32_t tsAlternativeRole;
extern
int32_t
tsBalanceInterval
;
extern
int32_t
tsOfflineThreshold
;
extern
int32_t
tsMnodeEqualVnodeNum
;
extern
int32_t
tsFlowCtrl
;
extern
int32_t
tsEnableFlowCtrl
;
extern
int32_t
tsEnableSlaveQuery
;
// restful
extern
int32_t
tsEnableHttpModule
;
...
...
src/common/src/tglobal.c
浏览文件 @
9f4a8ba7
...
...
@@ -138,7 +138,8 @@ int32_t tsAlternativeRole = 0;
int32_t
tsBalanceInterval
=
300
;
// seconds
int32_t
tsOfflineThreshold
=
86400
*
100
;
// seconds 10days
int32_t
tsMnodeEqualVnodeNum
=
4
;
int32_t
tsFlowCtrl
=
1
;
int32_t
tsEnableFlowCtrl
=
1
;
int32_t
tsEnableSlaveQuery
=
1
;
// restful
int32_t
tsEnableHttpModule
=
1
;
...
...
@@ -542,7 +543,7 @@ static void doInitGlobalConfig(void) {
cfg
.
ptr
=
&
tsOfflineThreshold
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
5
;
cfg
.
minValue
=
3
;
cfg
.
maxValue
=
7200000
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_SECOND
;
...
...
@@ -1004,7 +1005,17 @@ static void doInitGlobalConfig(void) {
// module configs
cfg
.
option
=
"flowctrl"
;
cfg
.
ptr
=
&
tsFlowCtrl
;
cfg
.
ptr
=
&
tsEnableFlowCtrl
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
0
;
cfg
.
maxValue
=
1
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
cfg
.
option
=
"slaveQuery"
;
cfg
.
ptr
=
&
tsEnableSlaveQuery
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
0
;
...
...
src/dnode/src/dnodeMain.c
浏览文件 @
9f4a8ba7
...
...
@@ -113,6 +113,7 @@ static void dnodeCleanupTmr() {
int32_t
dnodeInitSystem
()
{
dnodeSetRunStatus
(
TSDB_RUN_STATUS_INITIALIZE
);
tscEmbedded
=
1
;
taosIgnSIGPIPE
();
taosBlockSIGPIPE
();
taosResolveCRC
();
taosInitGlobalCfg
();
...
...
@@ -120,7 +121,6 @@ int32_t dnodeInitSystem() {
taosSetCoreDump
();
taosInitNotes
();
dnodeInitTmr
();
signal
(
SIGPIPE
,
SIG_IGN
);
if
(
dnodeCreateDir
(
tsLogDir
)
<
0
)
{
printf
(
"failed to create dir: %s, reason: %s
\n
"
,
tsLogDir
,
strerror
(
errno
));
...
...
src/dnode/src/dnodeVRead.c
浏览文件 @
9f4a8ba7
...
...
@@ -54,6 +54,7 @@ void dnodeCleanupVRead() {
void
dnodeDispatchToVReadQueue
(
SRpcMsg
*
pMsg
)
{
int32_t
queuedMsgNum
=
0
;
int32_t
leftLen
=
pMsg
->
contLen
;
int32_t
code
=
TSDB_CODE_VND_INVALID_VGROUP_ID
;
char
*
pCont
=
pMsg
->
pCont
;
while
(
leftLen
>
0
)
{
...
...
@@ -64,7 +65,7 @@ void dnodeDispatchToVReadQueue(SRpcMsg *pMsg) {
assert
(
pHead
->
contLen
>
0
);
void
*
pVnode
=
vnodeAcquire
(
pHead
->
vgId
);
if
(
pVnode
!=
NULL
)
{
int32_t
code
=
vnodeWriteToRQueue
(
pVnode
,
pCont
,
pHead
->
contLen
,
TAOS_QTYPE_RPC
,
pMsg
);
code
=
vnodeWriteToRQueue
(
pVnode
,
pCont
,
pHead
->
contLen
,
TAOS_QTYPE_RPC
,
pMsg
);
if
(
code
==
TSDB_CODE_SUCCESS
)
queuedMsgNum
++
;
vnodeRelease
(
pVnode
);
}
...
...
@@ -74,7 +75,7 @@ void dnodeDispatchToVReadQueue(SRpcMsg *pMsg) {
}
if
(
queuedMsgNum
==
0
)
{
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
handle
,
.
code
=
TSDB_CODE_VND_INVALID_VGROUP_ID
};
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
handle
,
.
code
=
code
};
rpcSendResponse
(
&
rpcRsp
);
}
...
...
src/dnode/src/dnodeVWrite.c
浏览文件 @
9f4a8ba7
...
...
@@ -188,6 +188,7 @@ static void *dnodeProcessVWriteQueue(void *wparam) {
int32_t
numOfMsgs
;
int32_t
qtype
;
taosBlockSIGPIPE
();
dDebug
(
"dnode vwrite worker:%d is running"
,
pWorker
->
workerId
);
while
(
1
)
{
...
...
src/mnode/src/mnodeMnode.c
浏览文件 @
9f4a8ba7
...
...
@@ -377,6 +377,24 @@ static int32_t mnodeCreateMnodeCb(SMnodeMsg *pMsg, int32_t code) {
return
code
;
}
static
bool
mnodeAllOnline
()
{
void
*
pIter
=
NULL
;
bool
allOnline
=
true
;
while
(
1
)
{
SMnodeObj
*
pMnode
=
NULL
;
pIter
=
mnodeGetNextMnode
(
pIter
,
&
pMnode
);
if
(
pMnode
==
NULL
)
break
;
if
(
pMnode
->
role
!=
TAOS_SYNC_ROLE_MASTER
&&
pMnode
->
role
!=
TAOS_SYNC_ROLE_SLAVE
)
{
allOnline
=
false
;
mnodeDecMnodeRef
(
pMnode
);
}
}
mnodeCancelGetNextMnode
(
pIter
);
return
allOnline
;
}
void
mnodeCreateMnode
(
int32_t
dnodeId
,
char
*
dnodeEp
,
bool
needConfirm
)
{
SMnodeObj
*
pMnode
=
calloc
(
1
,
sizeof
(
SMnodeObj
));
pMnode
->
mnodeId
=
dnodeId
;
...
...
@@ -389,6 +407,11 @@ void mnodeCreateMnode(int32_t dnodeId, char *dnodeEp, bool needConfirm) {
.
fpRsp
=
mnodeCreateMnodeCb
};
if
(
needConfirm
&&
!
mnodeAllOnline
())
{
mDebug
(
"wait all mnode online then create new mnode"
);
return
;
}
int32_t
code
=
TSDB_CODE_SUCCESS
;
if
(
needConfirm
)
{
code
=
mnodeSendCreateMnodeMsg
(
dnodeId
,
dnodeEp
);
...
...
src/mnode/src/mnodeSdb.c
浏览文件 @
9f4a8ba7
...
...
@@ -1081,6 +1081,8 @@ static void *sdbWorkerFp(void *pWorker) {
int32_t
qtype
;
void
*
unUsed
;
taosBlockSIGPIPE
();
while
(
1
)
{
int32_t
numOfMsgs
=
taosReadAllQitemsFromQset
(
tsSdbWQset
,
tsSdbWQall
,
&
unUsed
);
if
(
numOfMsgs
==
0
)
{
...
...
src/mnode/src/mnodeVgroup.c
浏览文件 @
9f4a8ba7
...
...
@@ -659,7 +659,7 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
pShow
->
bytes
[
cols
]
=
4
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_INT
;
strcpy
(
pSchema
[
cols
].
name
,
"online
Vnode
s"
);
strcpy
(
pSchema
[
cols
].
name
,
"onlines"
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
...
...
@@ -674,13 +674,13 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p
for
(
int32_t
i
=
0
;
i
<
pShow
->
maxReplica
;
++
i
)
{
pShow
->
bytes
[
cols
]
=
2
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_SMALLINT
;
snprintf
(
pSchema
[
cols
].
name
,
TSDB_COL_NAME_LEN
,
"v%d
D
node"
,
i
+
1
);
snprintf
(
pSchema
[
cols
].
name
,
TSDB_COL_NAME_LEN
,
"v%d
_d
node"
,
i
+
1
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
pShow
->
bytes
[
cols
]
=
9
+
VARSTR_HEADER_SIZE
;
pSchema
[
cols
].
type
=
TSDB_DATA_TYPE_BINARY
;
snprintf
(
pSchema
[
cols
].
name
,
TSDB_COL_NAME_LEN
,
"v%d
S
tatus"
,
i
+
1
);
snprintf
(
pSchema
[
cols
].
name
,
TSDB_COL_NAME_LEN
,
"v%d
_s
tatus"
,
i
+
1
);
pSchema
[
cols
].
bytes
=
htons
(
pShow
->
bytes
[
cols
]);
cols
++
;
}
...
...
src/os/inc/osSocket.h
浏览文件 @
9f4a8ba7
...
...
@@ -59,6 +59,7 @@ extern "C" {
// TAOS_OS_FUNC_SOCKET
int32_t
taosSetNonblocking
(
SOCKET
sock
,
int32_t
on
);
void
taosIgnSIGPIPE
();
void
taosBlockSIGPIPE
();
// TAOS_OS_FUNC_SOCKET_SETSOCKETOPT
...
...
src/os/src/detail/osSocket.c
浏览文件 @
9f4a8ba7
...
...
@@ -39,6 +39,10 @@ int32_t taosSetNonblocking(SOCKET sock, int32_t on) {
return
0
;
}
void
taosIgnSIGPIPE
()
{
signal
(
SIGPIPE
,
SIG_IGN
);
}
void
taosBlockSIGPIPE
()
{
sigset_t
signal_mask
;
sigemptyset
(
&
signal_mask
);
...
...
src/os/src/windows/wSocket.c
浏览文件 @
9f4a8ba7
...
...
@@ -46,6 +46,7 @@ int32_t taosSetNonblocking(SOCKET sock, int32_t on) {
return
0
;
}
void
taosIgnSIGPIPE
()
{}
void
taosBlockSIGPIPE
()
{}
int32_t
taosSetSockOpt
(
SOCKET
socketfd
,
int32_t
level
,
int32_t
optname
,
void
*
optval
,
int32_t
optlen
)
{
...
...
src/sync/inc/syncInt.h
浏览文件 @
9f4a8ba7
...
...
@@ -38,7 +38,7 @@ extern "C" {
#define SYNC_MAX_FWDS 512
#define SYNC_FWD_TIMER 300
#define SYNC_ROLE_TIMER 15000 // ms
#define SYNC_CHECK_INTERVAL 1
// ms
#define SYNC_CHECK_INTERVAL 1
000
// ms
#define SYNC_WAIT_AFTER_CHOOSE_MASTER 10 // ms
#define nodeRole pNode->peerInfo[pNode->selfIndex]->role
...
...
@@ -86,9 +86,10 @@ typedef struct SsyncPeer {
int32_t
peerFd
;
// forward FD
int32_t
numOfRetrieves
;
// number of retrieves tried
int32_t
fileChanged
;
// a flag to indicate file is changed during retrieving process
int32_t
refCount
;
int64_t
rid
;
void
*
timer
;
void
*
pConn
;
int32_t
refCount
;
// reference count
struct
SSyncNode
*
pSyncNode
;
}
SSyncPeer
;
...
...
@@ -98,6 +99,7 @@ typedef struct SSyncNode {
int8_t
quorum
;
int8_t
selfIndex
;
uint32_t
vgId
;
int32_t
refCount
;
int64_t
rid
;
SSyncPeer
*
peerInfo
[
TAOS_SYNC_MAX_REPLICA
+
1
];
// extra one for arbitrator
SSyncPeer
*
pMaster
;
...
...
@@ -121,13 +123,13 @@ extern int32_t tsSyncNum;
extern
char
tsNodeFqdn
[
TSDB_FQDN_LEN
];
extern
char
*
syncStatus
[];
void
*
syncRetrieveData
(
void
*
param
);
void
*
syncRestoreData
(
void
*
param
);
int32_t
syncSaveIntoBuffer
(
SSyncPeer
*
pPeer
,
SWalHead
*
pHead
);
void
syncRestartConnection
(
SSyncPeer
*
pPeer
);
void
syncBroadcastStatus
(
SSyncNode
*
pNode
);
void
syncAddPeerRef
(
SSyncPeer
*
pPeer
);
int32_t
syncDecPeerRef
(
SSyncPeer
*
pPeer
);
void
*
syncRetrieveData
(
void
*
param
);
void
*
syncRestoreData
(
void
*
param
);
int32_t
syncSaveIntoBuffer
(
SSyncPeer
*
pPeer
,
SWalHead
*
pHead
);
void
syncRestartConnection
(
SSyncPeer
*
pPeer
);
void
syncBroadcastStatus
(
SSyncNode
*
pNode
);
SSyncPeer
*
syncAcquirePeer
(
int64_t
rid
);
void
syncReleasePeer
(
SSyncPeer
*
pPeer
);
#ifdef __cplusplus
}
...
...
src/sync/inc/syncTcp.h
浏览文件 @
9f4a8ba7
...
...
@@ -25,14 +25,14 @@ typedef struct {
uint32_t
serverIp
;
int16_t
port
;
int32_t
bufferSize
;
void
(
*
processBrokenLink
)(
void
*
ahandle
);
int32_t
(
*
processIncomingMsg
)(
void
*
ahandle
,
void
*
buffer
);
void
(
*
processBrokenLink
)(
int64_t
handleId
);
int32_t
(
*
processIncomingMsg
)(
int64_t
handleId
,
void
*
buffer
);
void
(
*
processIncomingConn
)(
int32_t
fd
,
uint32_t
ip
);
}
SPoolInfo
;
void
*
syncOpenTcpThreadPool
(
SPoolInfo
*
pInfo
);
void
syncCloseTcpThreadPool
(
void
*
);
void
*
syncAllocateTcpConn
(
void
*
,
void
*
ahandle
,
int32_t
connFd
);
void
*
syncAllocateTcpConn
(
void
*
,
int64_t
rid
,
int32_t
connFd
);
void
syncFreeTcpConn
(
void
*
);
#ifdef __cplusplus
...
...
src/sync/src/syncArbitrator.c
浏览文件 @
9f4a8ba7
...
...
@@ -29,8 +29,8 @@
static
void
arbSignalHandler
(
int32_t
signum
,
siginfo_t
*
sigInfo
,
void
*
context
);
static
void
arbProcessIncommingConnection
(
int32_t
connFd
,
uint32_t
sourceIp
);
static
void
arbProcessBrokenLink
(
void
*
param
);
static
int32_t
arbProcessPeerMsg
(
void
*
param
,
void
*
buffer
);
static
void
arbProcessBrokenLink
(
int64_t
rid
);
static
int32_t
arbProcessPeerMsg
(
int64_t
rid
,
void
*
buffer
);
static
tsem_t
tsArbSem
;
static
void
*
tsArbTcpPool
;
...
...
@@ -138,20 +138,20 @@ static void arbProcessIncommingConnection(int32_t connFd, uint32_t sourceIp) {
sDebug
(
"%s, arbitrator request is accepted"
,
pNode
->
id
);
pNode
->
nodeFd
=
connFd
;
pNode
->
pConn
=
syncAllocateTcpConn
(
tsArbTcpPool
,
pNode
,
connFd
);
pNode
->
pConn
=
syncAllocateTcpConn
(
tsArbTcpPool
,
(
int64_t
)
pNode
,
connFd
);
return
;
}
static
void
arbProcessBrokenLink
(
void
*
param
)
{
SNodeConn
*
pNode
=
param
;
static
void
arbProcessBrokenLink
(
int64_t
rid
)
{
SNodeConn
*
pNode
=
(
SNodeConn
*
)
rid
;
sDebug
(
"%s, TCP link is broken since %s, close connection"
,
pNode
->
id
,
strerror
(
errno
));
tfree
(
pNode
);
}
static
int32_t
arbProcessPeerMsg
(
void
*
param
,
void
*
buffer
)
{
SNodeConn
*
pNode
=
param
;
static
int32_t
arbProcessPeerMsg
(
int64_t
rid
,
void
*
buffer
)
{
SNodeConn
*
pNode
=
(
SNodeConn
*
)
rid
;
SSyncHead
head
;
int32_t
bytes
=
0
;
char
*
cont
=
(
char
*
)
buffer
;
...
...
src/sync/src/syncMain.c
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
src/sync/src/syncRestore.c
浏览文件 @
9f4a8ba7
...
...
@@ -90,15 +90,18 @@ static int32_t syncRestoreFile(SSyncPeer *pPeer, uint64_t *fversion) {
break
;
}
sDebug
(
"%s, file:%s info is received from master, index:%d size:%"
PRId64
" fver:%"
PRIu64
" magic:%d"
,
pPeer
->
id
,
minfo
.
name
,
minfo
.
index
,
minfo
.
size
,
minfo
.
fversion
,
minfo
.
magic
);
// remove extra files on slave between the current and last index
syncRemoveExtraFile
(
pPeer
,
pindex
+
1
,
minfo
.
index
-
1
);
pindex
=
minfo
.
index
;
// check the file info
sinfo
=
minfo
;
s
Debug
(
"%s, get file:%s info size:%"
PRId64
,
pPeer
->
id
,
minfo
.
name
,
minfo
.
size
);
s
info
.
magic
=
(
*
pNode
->
getFileInfo
)(
pNode
->
vgId
,
sinfo
.
name
,
&
sinfo
.
index
,
TAOS_SYNC_MAX_INDEX
,
&
sinfo
.
siz
e
,
&
sinfo
.
fversion
);
s
info
.
magic
=
(
*
pNode
->
getFileInfo
)(
pNode
->
vgId
,
sinfo
.
name
,
&
sinfo
.
index
,
TAOS_SYNC_MAX_INDEX
,
&
sinfo
.
size
,
&
sinfo
.
fversion
);
s
Debug
(
"%s, local file:%s info, index:%d size:%"
PRId64
" fver:%"
PRIu64
" magic:%d"
,
pPeer
->
id
,
sinfo
.
nam
e
,
sinfo
.
index
,
sinfo
.
size
,
sinfo
.
fversion
,
sinfo
.
magic
);
// if file not there or magic is not the same, file shall be synced
memset
(
&
fileAck
,
0
,
sizeof
(
SFileAck
));
...
...
@@ -116,6 +119,8 @@ static int32_t syncRestoreFile(SSyncPeer *pPeer, uint64_t *fversion) {
if
(
fileAck
.
sync
==
0
)
{
sDebug
(
"%s, %s is the same"
,
pPeer
->
id
,
minfo
.
name
);
continue
;
}
else
{
sDebug
(
"%s, %s will be received, size:%"
PRId64
,
pPeer
->
id
,
minfo
.
name
,
minfo
.
size
);
}
// if sync is required, open file, receive from master, and write to file
...
...
@@ -155,7 +160,7 @@ static int32_t syncRestoreFile(SSyncPeer *pPeer, uint64_t *fversion) {
return
code
;
}
static
int32_t
syncRestoreWal
(
SSyncPeer
*
pPeer
)
{
static
int32_t
syncRestoreWal
(
SSyncPeer
*
pPeer
,
uint64_t
*
wver
)
{
SSyncNode
*
pNode
=
pPeer
->
pSyncNode
;
int32_t
ret
,
code
=
-
1
;
uint64_t
lastVer
=
0
;
...
...
@@ -198,6 +203,7 @@ static int32_t syncRestoreWal(SSyncPeer *pPeer) {
}
free
(
pHead
);
*
wver
=
lastVer
;
return
code
;
}
...
...
@@ -321,12 +327,19 @@ static int32_t syncRestoreDataStepByStep(SSyncPeer *pPeer) {
nodeVersion
=
fversion
;
sInfo
(
"%s, start to restore wal"
,
pPeer
->
id
);
if
(
syncRestoreWal
(
pPeer
)
<
0
)
{
sError
(
"%s, failed to restore wal"
,
pPeer
->
id
);
sInfo
(
"%s, start to restore wal, fver:%"
PRIu64
,
pPeer
->
id
,
nodeVersion
);
uint64_t
wver
=
0
;
code
=
syncRestoreWal
(
pPeer
,
&
wver
);
// lastwar
if
(
code
<
0
)
{
sError
(
"%s, failed to restore wal, code:%d"
,
pPeer
->
id
,
code
);
return
-
1
;
}
if
(
wver
!=
0
)
{
nodeVersion
=
wver
;
sDebug
(
"%s, restore wal finished, set sver:%"
PRIu64
,
pPeer
->
id
,
nodeVersion
);
}
nodeSStatus
=
TAOS_SYNC_STATUS_CACHE
;
sInfo
(
"%s, start to insert buffered points, set sstatus:%s"
,
pPeer
->
id
,
syncStatus
[
nodeSStatus
]);
if
(
syncProcessBufferedFwd
(
pPeer
)
<
0
)
{
...
...
@@ -338,7 +351,10 @@ static int32_t syncRestoreDataStepByStep(SSyncPeer *pPeer) {
}
void
*
syncRestoreData
(
void
*
param
)
{
SSyncPeer
*
pPeer
=
param
;
int64_t
rid
=
(
int64_t
)
param
;
SSyncPeer
*
pPeer
=
syncAcquirePeer
(
rid
);
if
(
pPeer
==
NULL
)
return
NULL
;
SSyncNode
*
pNode
=
pPeer
->
pSyncNode
;
taosBlockSIGPIPE
();
...
...
@@ -369,7 +385,7 @@ void *syncRestoreData(void *param) {
taosClose
(
pPeer
->
syncFd
);
syncCloseRecvBuffer
(
pNode
);
__sync_fetch_and_sub
(
&
tsSyncNum
,
1
);
sync
DecPeerRef
(
pPeer
);
sync
ReleasePeer
(
pPeer
);
return
NULL
;
}
src/sync/src/syncRetrieve.c
浏览文件 @
9f4a8ba7
...
...
@@ -104,7 +104,8 @@ static int32_t syncRetrieveFile(SSyncPeer *pPeer) {
fileInfo
.
magic
=
(
*
pNode
->
getFileInfo
)(
pNode
->
vgId
,
fileInfo
.
name
,
&
fileInfo
.
index
,
TAOS_SYNC_MAX_INDEX
,
&
fileInfo
.
size
,
&
fileInfo
.
fversion
);
syncBuildFileInfo
(
&
fileInfo
,
pNode
->
vgId
);
sDebug
(
"%s, file:%s info is sent, size:%"
PRId64
,
pPeer
->
id
,
fileInfo
.
name
,
fileInfo
.
size
);
sDebug
(
"%s, file:%s info is sent, index:%d size:%"
PRId64
" fver:%"
PRIu64
" magic:%d"
,
pPeer
->
id
,
fileInfo
.
name
,
fileInfo
.
index
,
fileInfo
.
size
,
fileInfo
.
fversion
,
fileInfo
.
magic
);
// send the file info
int32_t
ret
=
taosWriteMsg
(
pPeer
->
syncFd
,
&
(
fileInfo
),
sizeof
(
SFileInfo
));
...
...
@@ -144,6 +145,8 @@ static int32_t syncRetrieveFile(SSyncPeer *pPeer) {
fileInfo
.
index
++
;
sDebug
(
"%s, %s is the same"
,
pPeer
->
id
,
fileInfo
.
name
);
continue
;
}
else
{
sDebug
(
"%s, %s will be sent"
,
pPeer
->
id
,
fileInfo
.
name
);
}
// get the full path to file
...
...
@@ -461,7 +464,10 @@ static int32_t syncRetrieveDataStepByStep(SSyncPeer *pPeer) {
}
void
*
syncRetrieveData
(
void
*
param
)
{
SSyncPeer
*
pPeer
=
(
SSyncPeer
*
)
param
;
int64_t
rid
=
(
int64_t
)
param
;
SSyncPeer
*
pPeer
=
syncAcquirePeer
(
rid
);
if
(
pPeer
==
NULL
)
return
NULL
;
SSyncNode
*
pNode
=
pPeer
->
pSyncNode
;
taosBlockSIGPIPE
();
...
...
@@ -490,7 +496,7 @@ void *syncRetrieveData(void *param) {
pPeer
->
fileChanged
=
0
;
taosClose
(
pPeer
->
syncFd
);
sync
DecPeerRef
(
pPeer
);
sync
ReleasePeer
(
pPeer
);
return
NULL
;
}
src/sync/src/syncTcp.c
浏览文件 @
9f4a8ba7
...
...
@@ -42,7 +42,7 @@ typedef struct SPoolObj {
typedef
struct
{
SThreadObj
*
pThread
;
void
*
ahandle
;
int64_t
handleId
;
int32_t
fd
;
int32_t
closedByApp
;
}
SConnObj
;
...
...
@@ -112,7 +112,7 @@ void syncCloseTcpThreadPool(void *param) {
tfree
(
pPool
);
}
void
*
syncAllocateTcpConn
(
void
*
param
,
void
*
pPeer
,
int32_t
connFd
)
{
void
*
syncAllocateTcpConn
(
void
*
param
,
int64_t
rid
,
int32_t
connFd
)
{
struct
epoll_event
event
;
SPoolObj
*
pPool
=
param
;
...
...
@@ -130,7 +130,7 @@ void *syncAllocateTcpConn(void *param, void *pPeer, int32_t connFd) {
pConn
->
fd
=
connFd
;
pConn
->
pThread
=
pThread
;
pConn
->
ahandle
=
pPeer
;
pConn
->
handleId
=
rid
;
pConn
->
closedByApp
=
0
;
event
.
events
=
EPOLLIN
|
EPOLLRDHUP
;
...
...
@@ -164,7 +164,7 @@ static void taosProcessBrokenLink(SConnObj *pConn) {
SPoolInfo
*
pInfo
=
&
pPool
->
info
;
if
(
pConn
->
closedByApp
==
0
)
shutdown
(
pConn
->
fd
,
SHUT_WR
);
(
*
pInfo
->
processBrokenLink
)(
pConn
->
ahandle
);
(
*
pInfo
->
processBrokenLink
)(
pConn
->
handleId
);
pThread
->
numOfFds
--
;
epoll_ctl
(
pThread
->
pollFd
,
EPOLL_CTL_DEL
,
pConn
->
fd
,
NULL
);
...
...
@@ -221,7 +221,7 @@ static void *syncProcessTcpData(void *param) {
}
if
(
pConn
->
closedByApp
==
0
)
{
if
((
*
pInfo
->
processIncomingMsg
)(
pConn
->
ahandle
,
buffer
)
<
0
)
{
if
((
*
pInfo
->
processIncomingMsg
)(
pConn
->
handleId
,
buffer
)
<
0
)
{
syncFreeTcpConn
(
pConn
);
continue
;
}
...
...
src/util/src/tsocket.c
浏览文件 @
9f4a8ba7
...
...
@@ -18,6 +18,10 @@
#include "tsocket.h"
#include "taoserror.h"
#ifndef SIGPIPE
#define SIGPIPE EPIPE
#endif
int32_t
taosGetFqdn
(
char
*
fqdn
)
{
char
hostname
[
1024
];
hostname
[
1023
]
=
'\0'
;
...
...
@@ -115,6 +119,10 @@ int32_t taosWriteMsg(SOCKET fd, void *buf, int32_t nbytes) {
nleft
-=
nwritten
;
ptr
+=
nwritten
;
}
if
(
errno
==
SIGPIPE
||
errno
==
EPIPE
)
{
return
-
1
;
}
}
return
(
nbytes
-
nleft
);
...
...
@@ -142,6 +150,10 @@ int32_t taosReadMsg(SOCKET fd, void *buf, int32_t nbytes) {
nleft
-=
nread
;
ptr
+=
nread
;
}
if
(
errno
==
SIGPIPE
||
errno
==
EPIPE
)
{
return
-
1
;
}
}
return
(
nbytes
-
nleft
);
...
...
src/vnode/src/vnodeCfg.c
浏览文件 @
9f4a8ba7
...
...
@@ -106,9 +106,10 @@ int32_t vnodeReadCfg(SVnodeObj *pVnode) {
cJSON
*
vgCfgVersion
=
cJSON_GetObjectItem
(
root
,
"vgCfgVersion"
);
if
(
!
vgCfgVersion
||
vgCfgVersion
->
type
!=
cJSON_Number
)
{
vError
(
"vgId:%d, failed to read %s, vgCfgVersion not found"
,
pVnode
->
vgId
,
file
);
goto
PARSE_VCFG_ERROR
;
vnodeMsg
.
cfg
.
vgCfgVersion
=
0
;
}
else
{
vnodeMsg
.
cfg
.
vgCfgVersion
=
vgCfgVersion
->
valueint
;
}
vnodeMsg
.
cfg
.
vgCfgVersion
=
vgCfgVersion
->
valueint
;
cJSON
*
cacheBlockSize
=
cJSON_GetObjectItem
(
root
,
"cacheBlockSize"
);
if
(
!
cacheBlockSize
||
cacheBlockSize
->
type
!=
cJSON_Number
)
{
...
...
src/vnode/src/vnodeMgmt.c
浏览文件 @
9f4a8ba7
...
...
@@ -89,7 +89,10 @@ static void vnodeIncRef(void *ptNode) {
}
void
*
vnodeAcquire
(
int32_t
vgId
)
{
SVnodeObj
**
ppVnode
=
taosHashGetCB
(
tsVnodesHash
,
&
vgId
,
sizeof
(
int32_t
),
vnodeIncRef
,
NULL
,
sizeof
(
void
*
));
SVnodeObj
**
ppVnode
=
NULL
;
if
(
tsVnodesHash
!=
NULL
)
{
ppVnode
=
taosHashGetCB
(
tsVnodesHash
,
&
vgId
,
sizeof
(
int32_t
),
vnodeIncRef
,
NULL
,
sizeof
(
void
*
));
}
if
(
ppVnode
==
NULL
||
*
ppVnode
==
NULL
)
{
terrno
=
TSDB_CODE_VND_INVALID_VGROUP_ID
;
...
...
src/vnode/src/vnodeRead.c
浏览文件 @
9f4a8ba7
...
...
@@ -65,13 +65,17 @@ static int32_t vnodeCheckRead(SVnodeObj *pVnode) {
return
TSDB_CODE_APP_NOT_READY
;
}
if
(
pVnode
->
role
!=
TAOS_SYNC_ROLE_SLAVE
&&
pVnode
->
role
!=
TAOS_SYNC_ROLE_MASTER
)
{
vDebug
(
"vgId:%d, replica:%d role:%s, refCount:%d pVnode:%p"
,
pVnode
->
vgId
,
pVnode
->
syncCfg
.
replica
,
syncRole
[
pVnode
->
role
],
pVnode
->
refCount
,
pVnode
);
return
TSDB_CODE_APP_NOT_READY
;
if
(
pVnode
->
role
==
TAOS_SYNC_ROLE_MASTER
)
{
return
TSDB_CODE_SUCCESS
;
}
if
(
tsEnableSlaveQuery
&&
pVnode
->
role
==
TAOS_SYNC_ROLE_SLAVE
)
{
return
TSDB_CODE_SUCCESS
;
}
return
TSDB_CODE_SUCCESS
;
vDebug
(
"vgId:%d, replica:%d role:%s, refCount:%d pVnode:%p, cant provide query service"
,
pVnode
->
vgId
,
pVnode
->
syncCfg
.
replica
,
syncRole
[
pVnode
->
role
],
pVnode
->
refCount
,
pVnode
);
return
TSDB_CODE_APP_NOT_READY
;
}
void
vnodeFreeFromRQueue
(
void
*
vparam
,
SVReadMsg
*
pRead
)
{
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
9f4a8ba7
...
...
@@ -297,7 +297,7 @@ static int32_t vnodePerformFlowCtrl(SVWriteMsg *pWrite) {
if
(
pWrite
->
qtype
!=
TAOS_QTYPE_RPC
)
return
0
;
if
(
pVnode
->
queuedWMsg
<
MAX_QUEUED_MSG_NUM
&&
pVnode
->
flowctrlLevel
<=
0
)
return
0
;
if
(
tsFlowCtrl
==
0
)
{
if
(
ts
Enable
FlowCtrl
==
0
)
{
int32_t
ms
=
pow
(
2
,
pVnode
->
flowctrlLevel
+
2
);
if
(
ms
>
100
)
ms
=
100
;
vTrace
(
"vgId:%d, msg:%p, app:%p, perform flowctrl for %d ms"
,
pVnode
->
vgId
,
pWrite
,
pWrite
->
rpcMsg
.
ahandle
,
ms
);
...
...
tests/script/general/db/alter_tables_d2.sim
浏览文件 @
9f4a8ba7
...
...
@@ -11,11 +11,26 @@ system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 5
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
sleep 3000
sql connect
sql create dnode $hostname2
sleep 1000
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
print ============================ step1
...
...
@@ -80,10 +95,23 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 10
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 10
sleep 5000
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
sleep 5000
$x = 0
step2:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step1
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step2
endi
sql create table db.t100 using db.st tags(0)
sql create table db.t101 using db.st tags(1)
...
...
@@ -110,7 +138,6 @@ if $rows != 40 then
return -1
endi
sql insert into db.t100 values(now, 1)
sql insert into db.t101 values(now, 1)
sql insert into db.t102 values(now, 1)
...
...
@@ -144,10 +171,24 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 15
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 15
sleep 5000
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
sleep 5000
$x = 0
step3:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step3
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step3
endi
sql create table db.t200 using db.st tags(0)
sql create table db.t201 using db.st tags(1)
...
...
@@ -198,7 +239,7 @@ sql insert into db.t219 values(now, 1)
print ============================ step6
sql reset query cache
sleep 100
0
sleep 100
sql select * from db.t000
if $rows != 1 then
...
...
@@ -268,10 +309,23 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 20
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 20
sleep 5000
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
sleep 5000
$x = 0
step9:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step9
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step9
endi
sql create table db.t300 using db.st tags(0)
sql create table db.t301 using db.st tags(1)
...
...
@@ -321,7 +375,7 @@ if $rows != 80 then
endi
sql reset query cache
sleep 100
0
sleep 100
sql select * from db.t000
if $rows != 1 then
...
...
@@ -351,13 +405,26 @@ endi
print ============================ step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 5000
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
sleep 5000
$x = 0
step10:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step10
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step10
endi
sql reset query cache
sleep 100
0
sleep 100
sql show db.tables
if $rows != 80 then
...
...
@@ -401,10 +468,23 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 25
system sh/cfg.sh -n dnode2 -c maxTablesPerVnode -v 25
sleep 5000
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
sleep 5000
$x = 0
step1xx:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step1xx
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step1xx
endi
sql create table db.t400 using db.st tags(0)
sql create table db.t401 using db.st tags(1)
...
...
@@ -454,7 +534,7 @@ if $rows != 100 then
endi
sql reset query cache
sleep 100
0
sleep 100
sql select * from db.t000
if $rows != 1 then
...
...
tests/script/general/db/alter_tables_v1.sim
浏览文件 @
9f4a8ba7
...
...
@@ -5,8 +5,6 @@ system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 10
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ step1
...
...
@@ -51,9 +49,22 @@ print ============================ step3
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 20
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
$x = 0
step2:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step2
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step2
endi
sql create table db.t10 using db.st tags(0)
sql create table db.t11 using db.st tags(1)
...
...
@@ -91,9 +102,22 @@ endi
print ============================ step5
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 30
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
$x = 0
step5:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step5
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step5
endi
sql create table db.t20 using db.st tags(0)
sql create table db.t21 using db.st tags(1)
...
...
@@ -124,7 +148,7 @@ sql insert into db.t29 values(now, 1)
print ============================ step6
sql reset query cache
sleep 100
0
sleep 100
sql select * from db.t0
if $rows != 1 then
...
...
@@ -148,9 +172,22 @@ endi
print ============================ step7
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
$x = 0
step7:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step7
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step7
endi
sql reset query cache
sleep 1000
...
...
@@ -190,9 +227,22 @@ endi
print ============================ step9
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 40
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
$x = 0
step9:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step9
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step9
endi
sql create table db.t30 using db.st tags(0)
sql create table db.t31 using db.st tags(1)
...
...
@@ -249,12 +299,24 @@ if $rows != 40 then
return -1
endi
print ============================ step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
$x = 0
step10:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step10
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step10
endi
sql reset query cache
sleep 1000
...
...
@@ -294,9 +356,22 @@ endi
print ============================ step12
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 50
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
$x = 0
step12:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step12
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step12
endi
sql create table db.t40 using db.st tags(0)
sql create table db.t41 using db.st tags(1)
...
...
tests/script/general/db/alter_tables_v4.sim
浏览文件 @
9f4a8ba7
...
...
@@ -5,8 +5,6 @@ system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 4
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 5
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============================ step1
...
...
@@ -70,9 +68,22 @@ endi
print ============================ step3
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 10
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
$x = 0
step3:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step3
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step3
endi
sql create table db.t100 using db.st tags(0)
sql create table db.t101 using db.st tags(1)
...
...
@@ -131,9 +142,22 @@ endi
print ============================ step5
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 15
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
$x = 0
step5:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step5
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step5
endi
sql create table db.t200 using db.st tags(0)
sql create table db.t201 using db.st tags(1)
...
...
@@ -184,7 +208,7 @@ sql insert into db.t219 values(now, 1)
print ============================ step6
sql reset query cache
sleep 100
0
sleep 100
sql select * from db.t000
if $rows != 1 then
...
...
@@ -250,9 +274,22 @@ endi
print ============================ step9
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 20
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
$x = 0
step9:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step9
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step9
endi
sql create table db.t300 using db.st tags(0)
sql create table db.t301 using db.st tags(1)
...
...
@@ -331,9 +368,22 @@ endi
print ============================ step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
$x = 0
step10:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step10
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step10
endi
sql reset query cache
sleep 1000
...
...
@@ -378,9 +428,24 @@ endi
print ============================ step12
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 25
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
$x = 0
step12:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show mnodes -x step12
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step12
endi
sql create table db.t400 using db.st tags(0)
sql create table db.t401 using db.st tags(1)
sql create table db.t402 using db.st tags(2)
...
...
tests/script/general/db/delete_reusevnode.sim
浏览文件 @
9f4a8ba7
...
...
@@ -5,7 +5,6 @@ system sh/deploy.sh -n dnode1 -i 1
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ======== step1
...
...
@@ -38,7 +37,6 @@ if $rows != 0 then
endi
system sh/stop_dnodes.sh
sleep 3000
system sh/deploy.sh -n dnode1 -i 1
print ========= start dnodes
...
...
tests/script/general/db/delete_writing1.sim
浏览文件 @
9f4a8ba7
...
...
@@ -22,7 +22,6 @@ system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
sql create database db
...
...
tests/script/general/table/delete_writing.sim
浏览文件 @
9f4a8ba7
...
...
@@ -21,8 +21,6 @@ system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
sql create database db
...
...
tests/script/general/wal/sync.sim
浏览文件 @
9f4a8ba7
...
...
@@ -31,7 +31,6 @@ system sh/cfg.sh -n dnode3 -c maxSQLLength -v 940032
print ============== deploy
system sh/exec.sh -n dnode1 -s start
sleep 5001
sql connect
sql create dnode $hostname2
...
...
@@ -43,8 +42,8 @@ print =============== step1
$x = 0
show1:
$x = $x + 1
sleep
2
000
if $x ==
5
then
sleep
1
000
if $x ==
10
then
return -1
endi
sql show mnodes -x show1
...
...
@@ -82,7 +81,7 @@ restful d1 table_rest 1591772800 30000
restful d1 table_rest 1591872800 30000
restful d1 table_rest 1591972800 30000
sleep 100
0
sleep 100
sql select * from table_rest;
print rows: $rows
if $rows != 300000 then
...
...
@@ -91,29 +90,51 @@ endi
print =============== step3
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 5000
sql select * from table_rest;
print rows: $rows
if $rows != 300000 then
return -1
endi
system sh/exec.sh -n dnode1 -s start -x SIGINT
sleep 5000
$x = 0
a1:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show vgroups
print online vnodes $data03
if $data03 != 3 then
goto a1
endi
print =============== step4
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 5000
sql select * from table_rest;
print rows: $rows
if $rows != 300000 then
return -1
endi
system sh/exec.sh -n dnode2 -s start -x SIGINT
sleep 5000
$x = 0
a2:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show vgroups
print online vnodes $data03
if $data03 != 3 then
goto a2
endi
print =============== step5
system sh/exec.sh -n dnode3 -s stop -x SIGINT
sleep 5000
sql select * from table_rest;
print rows: $rows
if $rows != 300000 then
...
...
tests/script/jenkins/basic.txt
浏览文件 @
9f4a8ba7
...
...
@@ -288,6 +288,7 @@ cd ../../../debug; make
./test.sh -f unique/dnode/data1.sim
./test.sh -f unique/dnode/offline1.sim
./test.sh -f unique/dnode/offline2.sim
./test.sh -f unique/dnode/offline3.sim
./test.sh -f unique/dnode/reason.sim
./test.sh -f unique/dnode/remove1.sim
./test.sh -f unique/dnode/remove2.sim
...
...
tests/script/jenkins/basic_3.txt
浏览文件 @
9f4a8ba7
./test.sh -f unique/stable/balance_replica1.sim
./test.sh -f unique/stable/dnode2_stop.sim
./test.sh -f unique/stable/dnode2.sim
./test.sh -f unique/stable/dnode3.sim
./test.sh -f unique/stable/replica2_dnode4.sim
./test.sh -f unique/stable/replica2_vnode3.sim
./test.sh -f unique/stable/replica3_dnode6.sim
./test.sh -f unique/stable/replica3_vnode3.sim
./test.sh -f unique/mnode/mgmt20.sim
./test.sh -f unique/mnode/mgmt21.sim
./test.sh -f unique/mnode/mgmt22.sim
./test.sh -f unique/mnode/mgmt23.sim
./test.sh -f unique/mnode/mgmt24.sim
#./test.sh -f unique/mnode/mgmt25.sim
#./test.sh -f unique/mnode/mgmt26.sim
./test.sh -f unique/mnode/mgmt33.sim
./test.sh -f unique/mnode/mgmt34.sim
./test.sh -f unique/mnode/mgmtr2.sim
./test.sh -f general/parser/stream_on_sys.sim
./test.sh -f general/stream/metrics_del.sim
./test.sh -f general/stream/metrics_n.sim
./test.sh -f general/stream/metrics_replica1_vnoden.sim
./test.sh -f general/stream/restart_stream.sim
./test.sh -f general/stream/stream_3.sim
./test.sh -f general/stream/stream_restart.sim
./test.sh -f general/stream/table_1.sim
./test.sh -f general/stream/table_del.sim
./test.sh -f general/stream/table_n.sim
./test.sh -f general/stream/table_replica1_vnoden.sim
./test.sh -f unique/arbitrator/check_cluster_cfg_para.sim
#./test.sh -f unique/arbitrator/dn2_mn1_cache_file_sync.sim
./test.sh -f unique/arbitrator/dn3_mn1_full_createTableFail.sim
...
...
@@ -79,3 +45,35 @@
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
./test.sh -f unique/stable/balance_replica1.sim
./test.sh -f unique/stable/dnode2_stop.sim
./test.sh -f unique/stable/dnode2.sim
./test.sh -f unique/stable/dnode3.sim
./test.sh -f unique/stable/replica2_dnode4.sim
./test.sh -f unique/stable/replica2_vnode3.sim
./test.sh -f unique/stable/replica3_dnode6.sim
./test.sh -f unique/stable/replica3_vnode3.sim
./test.sh -f unique/mnode/mgmt20.sim
./test.sh -f unique/mnode/mgmt21.sim
./test.sh -f unique/mnode/mgmt22.sim
./test.sh -f unique/mnode/mgmt23.sim
./test.sh -f unique/mnode/mgmt24.sim
#./test.sh -f unique/mnode/mgmt25.sim
#./test.sh -f unique/mnode/mgmt26.sim
./test.sh -f unique/mnode/mgmt33.sim
./test.sh -f unique/mnode/mgmt34.sim
./test.sh -f unique/mnode/mgmtr2.sim
./test.sh -f general/parser/stream_on_sys.sim
./test.sh -f general/stream/metrics_del.sim
./test.sh -f general/stream/metrics_n.sim
./test.sh -f general/stream/metrics_replica1_vnoden.sim
./test.sh -f general/stream/restart_stream.sim
./test.sh -f general/stream/stream_3.sim
./test.sh -f general/stream/stream_restart.sim
./test.sh -f general/stream/table_1.sim
./test.sh -f general/stream/table_del.sim
./test.sh -f general/stream/table_n.sim
./test.sh -f general/stream/table_replica1_vnoden.sim
tests/script/jenkins/unique.txt
浏览文件 @
9f4a8ba7
...
...
@@ -31,6 +31,8 @@ cd ../../../debug; make
./test.sh -f unique/dnode/balancex.sim
./test.sh -f unique/dnode/offline1.sim
./test.sh -f unique/dnode/offline2.sim
./test.sh -f unique/dnode/offline3.sim
./test.sh -f unique/dnode/reason.sim
./test.sh -f unique/dnode/remove1.sim
./test.sh -f unique/dnode/remove2.sim
./test.sh -f unique/dnode/vnode_clean.sim
...
...
tests/script/sh/deploy.sh
浏览文件 @
9f4a8ba7
...
...
@@ -132,10 +132,12 @@ echo "cqdebugFlag 143" >> $TAOS_CFG
echo
"monitor 0"
>>
$TAOS_CFG
echo
"monitorInterval 1"
>>
$TAOS_CFG
echo
"http 0"
>>
$TAOS_CFG
echo
"slaveQuery 0"
>>
$TAOS_CFG
echo
"numOfThreadsPerCore 2.0"
>>
$TAOS_CFG
echo
"defaultPass taosdata"
>>
$TAOS_CFG
echo
"numOfLogLines 20000000"
>>
$TAOS_CFG
echo
"mnodeEqualVnodeNum 0"
>>
$TAOS_CFG
echo
"balanceInterval 1"
>>
$TAOS_CFG
echo
"clog 2"
>>
$TAOS_CFG
#echo "cache 1" >> $TAOS_CFG
echo
"days 10"
>>
$TAOS_CFG
...
...
tests/script/unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim
浏览文件 @
9f4a8ba7
...
...
@@ -360,12 +360,14 @@ print ============== step7: stop dnode3/dnode2, and cluster unable to provide se
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
sleep 3000
sql_error select count(*) from $stb
sql select count(*) from $stb -x s71
s71:
print ============== step8: restart dnode2, and cluster Still unable to provide services
system sh/exec.sh -n dnode2 -s start
sleep 3000
sql_error select count(*) from $stb
sql select count(*) from $stb -x s81
s81:
print ============== step9: restart dnode3, and cluster Resume service delivery
system sh/exec.sh -n dnode3 -s start
...
...
tests/script/unique/arbitrator/dn3_mn1_replica_change.sim
浏览文件 @
9f4a8ba7
...
...
@@ -45,15 +45,30 @@ system sh/exec_tarbitrator.sh -s start
print ============== step1: start dnode1, only deploy mnode
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ============== step2: start dnode2 and add into cluster , then create database with replica 1, and create table, insert data
system sh/exec.sh -n dnode2 -s start
sql create dnode $hostname2
sleep 3000
$sleepTimer = 10000
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
$db = db
sql create database $db replica 1
...
...
@@ -84,7 +99,6 @@ while $i < $tblNum
endw
sql select count(*) from $stb
sleep 1000
print data00 $data00
if $data00 != $totalRows then
return -1
...
...
@@ -92,118 +106,65 @@ endi
print ============== step2-1: stop dnode2 for falling disc, then restart dnode2, and check rows
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep $sleepTimer
$loopCnt = 0
wait_dnode2_offline_0:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
endi
sql show dnodes
if $rows != 2 then
sleep 2000
goto wait_dnode2_offline_0
endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
#$dnode1Status = $data4_1
$dnode2Status = $data4_2
#$dnode3Status = $data4_3
#$dnode4Status = $data4_4
#$dnode5Status = $data4_5
if $dnode2Status != offline then
sleep 2000
goto wait_dnode2_offline_0
endi
system sh/exec.sh -n dnode2 -s start
sleep $sleepTimer
$x = 0
a0:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
$loopCnt = 0
wait_dnode2_reready:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
endi
sql show dnodes
if $rows != 2 then
sleep 2000
goto wait_dnode2_reready
endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
#$dnode1Status = $data4_1
$dnode2Status = $data4_2
#$dnode3Status = $data4_3
#$dnode4Status = $data4_4
#$dnode5Status = $data4_5
if $dnode2Status != ready then
sleep 2000
goto wait_dnode2_reready
sql show vgroups
print online vnodes $data03
if $data03 != 1 then
goto a0
endi
sql select count(*) from $stb
sleep 1000
print data00 $data00
if $data00 != $totalRows then
return -1
endi
print ============== step3: start dnode3 and add into cluster , then alter replica from 1 to 2, and waiting sync
system sh/exec.sh -n dnode3 -s start
sql create dnode $hostname3
sleep 3000
sql alter database $db replica 2
sleep $sleepTimer
$loopCnt = 0
wait_dnode3_ready:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
endi
$x = 0
step2:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show dnodes
if $rows != 3 then
sleep 2000
goto wait_dnode3_ready
endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
#$dnode1Status = $data4_1
$dnode2Status = $data4_2
$dnode3Status = $data4_3
#$dnode4Status = $data4_4
#$dnode5Status = $data4_5
if $dnode2Status != ready then
sleep 2000
goto wait_dnode3_ready
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
if $data4_3 != ready then
goto step2
endi
if $dnode3Status != ready then
sleep 2000
goto wait_dnode3_ready
sql alter database $db replica 2
$x = 0
a1:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show vgroups
print online vnodes $data03
if $data03 != 2 then
goto a1
endi
sleep $sleepTimer
# check using select
sql select count(*) from $stb
print data00 $data00
...
...
@@ -211,44 +172,22 @@ if $data00 != $totalRows then
return -1
endi
print ============== step4: stop dnode2 for checking if sync ok
system sh/exec.sh -n dnode2 -s stop
sleep $sleepTimer
$loopCnt = 0
wait_dnode2_offline:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
endi
$x = 0
a2:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show dnodes
if $rows != 3 then
sleep 2000
goto wait_dnode2_offline
endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
#$dnode1Status = $data4_1
$dnode2Status = $data4_2
$dnode3Status = $data4_3
#$dnode4Status = $data4_4
#$dnode5Status = $data4_5
if $dnode2Status != offline then
sleep 2000
goto wait_dnode2_offline
endi
if $dnode3Status != ready then
sleep 2000
goto wait_dnode2_offline
sql show vgroups
print online vnodes $data03
if $data03 != 1 then
goto a2
endi
sleep $sleepTimer # waitting for move master vnode of dnode2 to dnode3
# check using select
sql select count(*) from $stb
print data00 $data00
...
...
@@ -258,38 +197,20 @@ endi
print ============== step5: restart dnode2
system sh/exec.sh -n dnode2 -s start
sleep 3000
$loopCnt = 0
wait_dnode2_ready:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
endi
$x = 0
a3:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show dnodes
if $rows != 3 then
sleep 2000
goto wait_dnode2_ready
endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
#print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
#$dnode1Status = $data4_1
$dnode2Status = $data4_2
$dnode3Status = $data4_3
#$dnode4Status = $data4_4
#$dnode5Status = $data4_5
if $dnode2Status != ready then
sleep 2000
goto wait_dnode2_ready
sql show vgroups
print online vnodes $data03
if $data03 != 2 then
goto a3
endi
sleep $sleepTimer
# check using select
sql select count(*) from $stb
print data00 $data00
...
...
@@ -300,40 +221,39 @@ endi
print ============== step6: start dnode4 and add into cluster , then alter replica from 2 to 3, and waiting sync
system sh/exec.sh -n dnode4 -s start
sql create dnode $hostname4
sleep 3000
sql alter database $db replica 3
sleep $sleepTimer
$loopCnt = 0
wait_dnode4_ready:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
endi
$x = 0
step6:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
if $rows != 4 then
sleep 2000
goto wait_dnode4_ready
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
print dnode4 $data4_4
if $data4_4 != ready then
goto step6
endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
#$dnode1Status = $data4_1
#$dnode2Status = $data4_2
$dnode3Status = $data4_3
$dnode4Status = $data4_4
#$dnode5Status = $data4_5
if $dnode4Status != ready then
sleep 2000
goto wait_dnode4_ready
sql alter database $db replica 3
$x = 0
a4:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show vgroups
print online vnodes $data03
if $data03 != 3 then
goto a4
endi
sleep $sleepTimer
# check using select
sql select count(*) from $stb
print data00 $data00
...
...
@@ -343,44 +263,20 @@ endi
print ============== step7: alter replica from 3 to 2, and waiting sync
sql alter database $db replica 2
sleep $sleepTimer
$loopCnt = 0
wait_vgroups_replic_to_2:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
endi
$x = 0
a5:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show vgroups
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1 $data10_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2 $data10_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3 $data10_3
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 $data5_4 $data6_4 $data7_4 $data8_4 $data9_4 $data10_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
$thirdDnode_2 = $data8_1
$thirdDnode_3 = $data8_2
$thirdDnode_4 = $data8_3
$thirdDnode_5 = $data8_4
if $thirdDnode_2 != null then
sleep 2000
goto wait_vgroups_replic_to_2
endi
if $thirdDnode_3 != null then
sleep 2000
goto wait_vgroups_replic_to_2
endi
if $thirdDnode_4 != null then
sleep 2000
goto wait_vgroups_replic_to_2
endi
if $thirdDnode_5 != null then
sleep 2000
goto wait_vgroups_replic_to_2
sql show vgroups
print online vnodes $data03
if $data03 != 2 then
goto a5
endi
sleep $sleepTimer #waiting del one replica data
# check using select
sql select count(*) from $stb
print data00 $data00
...
...
@@ -390,85 +286,20 @@ endi
print ============== step8: alter replica from 2 to 1, and waiting sync
sql alter database $db replica 1
sleep $sleepTimer
$loopCnt = 0
wait_vgroups_replic_to_1:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
endi
$x = 0
a6:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show vgroups
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4 $data5_4 $data6_4 $data7_4 $data8_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
$sencodDnode_2 = $data6_1
$sencodDnode_3 = $data6_2
$sencodDnode_4 = $data6_3
$sencodDnode_5 = $data6_4
if $sencodDnode_2 != null then
sleep 2000
goto wait_vgroups_replic_to_1
endi
if $sencodDnode_3 != null then
sleep 2000
goto wait_vgroups_replic_to_1
endi
if $sencodDnode_4 != null then
sleep 2000
goto wait_vgroups_replic_to_1
endi
if $sencodDnode_5 != null then
sleep 2000
goto wait_vgroups_replic_to_1
endi
$loopCnt = 0
all_dnodes_ready:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
sql show vgroups
print online vnodes $data03
if $data03 != 1 then
goto a6
endi
sql show dnodes
if $rows != 4 then
sleep 2000
goto all_dnodes_ready
endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
$dnode1Status = $data4_1
$dnode2Status = $data4_2
$dnode3Status = $data4_3
$dnode4Status = $data4_4
#$dnode5Status = $data4_5
if $dnode1Status != ready then
sleep 2000
goto all_dnodes_ready
endi
if $dnode2Status != ready then
sleep 2000
goto all_dnodes_ready
endi
if $dnode3Status != ready then
sleep 2000
goto all_dnodes_ready
endi
if $dnode4Status != ready then
sleep 2000
goto all_dnodes_ready
endi
sleep $sleepTimer #waiting del one replica data
# check using select
sql select count(*) from $stb
print data00 $data00
...
...
@@ -481,39 +312,31 @@ sql drop dnode $hostname2
sql drop dnode $hostname3
sleep $sleepTimer
$loopCnt = 0
wait_dnode23_dropped:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
endi
$x = 0
step9:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show dnodes
if $rows != 2 then
sleep 2000
goto wait_dnode23_dropped
endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3
print $data0_4 $data1_4 $data2_4 $data3_4 $data4_4
#print $data0_5 $data1_5 $data2_5 $data3_5 $data4_5
#print $data0_6 $data1_6 $data2_6 $data3_6 $data4_6
$dnode1Status = $data4_1
$dnode2Status = $data4_2
$dnode3Status = $data4_3
$dnode4Status = $data4_4
if $dnode2Status != null then
sleep 2000
goto wait_dnode23_dropped
endi
if $dnode3Status != null then
sleep 2000
goto wait_dnode23_dropped
goto step9
endi
if $dnode4Status != ready then
return -1
$x = 0
a7:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show vgroups
print online vnodes $data03
if $data03 != 1 then
goto a7
endi
sleep $sleepTimer #waiting move vnode from dnode3/dnode3 to dnode4
...
...
@@ -523,3 +346,13 @@ print data00 $data00
if $data00 != $totalRows then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
tests/script/unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
浏览文件 @
9f4a8ba7
...
...
@@ -140,3 +140,11 @@ if $data00 != $totalRows then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
tests/script/unique/arbitrator/dn3_mn1_vnode_nomaster.sim
浏览文件 @
9f4a8ba7
...
...
@@ -158,13 +158,15 @@ if $dnode4Vtatus != offline then
sleep 2000
goto wait_dnode4_vgroup_offline
endi
if $dnode3Vtatus !=
unsynced
then
if $dnode3Vtatus !=
master
then
sleep 2000
goto wait_dnode4_vgroup_offline
endi
sql_error select count(*) from $stb
sql_error insert into $tb values (now, 9988)
sql select count(*) from $stb -x s31
s31:
#sql_error insert into $tb values (now, 9988) -x s32
#s32:
print ============== step4: restart dnode2, then create database with replica 2, and create table, insert data
system sh/exec.sh -n dnode2 -s start
...
...
tests/script/unique/arbitrator/sync_replica3_alterTable_add.sim
浏览文件 @
9f4a8ba7
...
...
@@ -140,11 +140,9 @@ if $rows != 1 then
goto wait_dnode4_vgroup_offline
endi
print show vgroups:
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $data7_2 $data8_2 $data9_2
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
$dnode4Vtatus = $data5_2
$dnode3Vtatus = $data7_2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
$dnode4Vtatus = $data05
$dnode3Vtatus = $data07
if $dnode4Vtatus != offline then
sleep 2000
...
...
@@ -198,7 +196,3 @@ if $data00 != $totalRows then
sleep 2000
goto wait_table_altered
endi
tests/script/unique/arbitrator/sync_replica_alterTable_background_add.sim
浏览文件 @
9f4a8ba7
...
...
@@ -14,6 +14,9 @@ sql alter table $stb add column f1 float
$tblNum = $totalTableNum
$alterTblNum = 10
sql reset query cache
sleep 100
$i = 1
while $i < $alterTblNum
$tb = tb . $i
...
...
tests/script/unique/big/balance.sim
浏览文件 @
9f4a8ba7
...
...
@@ -21,7 +21,6 @@ system sh/cfg.sh -n dnode5 -c maxTablesPerVnode -v 1000
print =============== prepare data
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
$i = 0
...
...
@@ -92,8 +91,8 @@ system sh/exec.sh -n dnode2 -s start
$x = 0
show1:
$x = $x + 1
sleep
3
000
if $x ==
1
0 then
sleep
1
000
if $x ==
3
0 then
return -1
endi
...
...
@@ -108,7 +107,7 @@ if $data2_2 != 2 then
endi
sql reset query cache
sleep 100
0
sleep 100
sql select count(*) from t10
print select count(*) from t10 $data00 expect $rowNum
...
...
@@ -143,7 +142,6 @@ endi
print ========== step2
sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
sleep 10000
print ========== step3
sql drop dnode $hostname2
...
...
@@ -151,8 +149,8 @@ sql drop dnode $hostname2
$x = 0
show3:
$x = $x + 1
sleep
3
000
if $x ==
1
0 then
sleep
1
000
if $x ==
3
0 then
return -1
endi
...
...
@@ -171,10 +169,9 @@ if $data2_3 != 2 then
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 5000
sql reset query cache
sleep 100
0
sleep 100
sql select count(*) from t10
print select count(*) from t10 $data00 expect $rowNum
...
...
@@ -212,8 +209,8 @@ sql drop dnode $hostname3
$x = 0
show4:
$x = $x + 1
sleep
3
000
if $x ==
1
0 then
sleep
1
000
if $x ==
3
0 then
return -1
endi
...
...
@@ -228,10 +225,9 @@ if $data2_3 != null then
endi
system sh/exec.sh -n dnode3 -s stop -x SIGINT
sleep 5000
sql reset query cache
sleep 100
0
sleep 100
sql select count(*) from t10
print select count(*) from t10 $data00 expect $rowNum
...
...
@@ -267,14 +263,31 @@ print ========== step5
system sh/exec.sh -n dnode4 -s start
sql create dnode $hostname4
sleep 3000
$x = 0
step5:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
print dnode4 $data4_4
if $data4_4 != ready then
goto step5
endi
sql alter database db replica 2
$x = 0
show5:
$x = $x + 1
sleep
3
000
if $x ==
1
0 then
sleep
1
000
if $x ==
3
0 then
return -1
endi
...
...
@@ -289,7 +302,7 @@ if $data2_4 != 4 then
endi
sql reset query cache
sleep 100
0
sleep 100
sql select count(*) from t10
print select count(*) from t10 $data00 expect $rowNum
...
...
@@ -321,16 +334,14 @@ if $data00 != $totalNum then
goto show5
endi
print ========== step6
sleep 3000
sql alter database db replica 1
$x = 0
show6:
$x = $x + 1
sleep
3
000
if $x ==
1
0 then
sleep
1
000
if $x ==
3
0 then
return -1
endi
...
...
@@ -345,7 +356,7 @@ if $data2_4 != 2 then
endi
sql reset query cache
sleep 100
0
sleep 100
sql select count(*) from t10
print select count(*) from t10 $data00 expect $rowNum
...
...
tests/script/unique/big/tcp.sim
浏览文件 @
9f4a8ba7
...
...
@@ -15,7 +15,6 @@ system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135
system sh/cfg.sh -n dnode1 -c debugFlag -v 131
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print ======================== dnode1 start
...
...
@@ -52,7 +51,7 @@ while $i < $tbNum
endw
$i = 0
while $i <
10
while $i <
5
print =============== step3 $i
sql select count(*) from $mt
print ===> $data00 $data01
...
...
@@ -83,7 +82,7 @@ while $i < $tbNum
endw
$i = 0
while $i <
10
while $i <
5
print =============== step5 $i
sql select count(*) from $mt where tgcol < 20200
print ===> $data00 $data01
...
...
tests/script/unique/cluster/balance1.sim
浏览文件 @
9f4a8ba7
...
...
@@ -84,16 +84,14 @@ endi
print ============================== step2
print ========= start dnode2
sleep 2000
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
sleep 5000
$x = 0
show2:
$x = $x + 1
sleep
2
000
if $x ==
2
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show dnodes -x show2
...
...
@@ -129,13 +127,12 @@ sql insert into c_b1_t3 values(1520000024031, 31)
print ============================== step4
print ========= drop dnode2
sql drop dnode $hostname2
sleep 9000
$x = 0
show4:
$x = $x + 1
sleep
2
000
if $x ==
2
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show dnodes -x show4
...
...
@@ -164,16 +161,14 @@ print dnode4 ==> $dnode4Role
print ============================== step5
print ========= add dnode2
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 5000
system sh/exec.sh -n dnode3 -s start
sql create dnode $hostname3
sleep 9000
$x = 0
show5:
$x = $x + 1
sleep
2
000
if $x ==
2
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show dnodes -x show5
...
...
@@ -212,13 +207,12 @@ sql_error create dnode $hostname1
print ============================== step8
sql drop dnode $hostname3
sleep 15000
$x = 0
show8:
$x = $x + 1
sleep
2
000
if $x ==
3
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show dnodes -x show8
...
...
@@ -253,13 +247,12 @@ endi
print ============================== step9
sql create dnode $hostname4
system sh/exec.sh -n dnode4 -s start
sleep 9000
$x = 0
show9:
$x = $x + 1
sleep
2
000
if $x ==
3
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show dnodes -x show9
...
...
@@ -302,8 +295,8 @@ sql insert into c_b1_t4 values(1520000024041, 41)
$x = 0
show10:
$x = $x + 1
sleep
2
000
if $x ==
3
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show dnodes -x show10
...
...
@@ -335,7 +328,23 @@ sql_error create table c_b1_t5 (t timestamp, i int) -x error3
print ============================== step13
sql create dnode $hostname5
system sh/exec.sh -n dnode5 -s start
sleep 9000
$x = 0
step13:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
print dnode4 $data4_4
print dnode4 $data4_5
if $data4_5 != ready then
goto step13
endi
sql show mnodes
$dnode1Role = $data2_1
...
...
@@ -383,7 +392,23 @@ endi
print ============================== step14
sql create dnode $hostname6
system sh/exec.sh -n dnode6 -s start
sleep 15000
$x = 0
step14:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
print dnode4 $data4_4
print dnode4 $data4_5
if $data4_6 != ready then
goto step14
endi
sql create database c_b1_d7
sql use c_b1_d7
...
...
@@ -406,7 +431,7 @@ sql insert into c_b1_t8 values(1520000024081, 81)
$x = 0
show14:
$x = $x + 1
sleep
2
000
sleep
1
000
if $x == 30 then
return -1
endi
...
...
@@ -440,7 +465,7 @@ print ============================== step17
print ========= check data
sql reset query cache
sleep 100
0
sleep 100
sql use c_b1_d1
sql select * from c_b1_d1.c_b1_t1
...
...
tests/script/unique/cluster/balance2.sim
浏览文件 @
9f4a8ba7
...
...
@@ -50,12 +50,48 @@ print ========= start dnode1
system sh/exec.sh -n dnode1 -s start
sql connect
sleep 4001
sql create dnode $hostname2
sql create dnode $hostname3
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
sleep 4001
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
print dnode4 $data4_4
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
if $data4_3 != ready then
goto step1
endi
sql show mnodes
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step1
endi
if $data2_2 != slave then
goto step1
endi
if $data2_3 != slave then
goto step1
endi
sql create database c_b2_d1 replica 2
sql use c_b2_d1
...
...
@@ -112,13 +148,12 @@ endi
print ============================== step2
print ========= drop dnode2
sql drop dnode $hostname2
sleep 9000
$x = 0
show2:
$x = $x + 1
sleep
3
000
if $x ==
2
0 then
sleep
1
000
if $x ==
3
0 then
return -1
endi
sql show dnodes -x show2
...
...
@@ -155,13 +190,12 @@ print ============================== step3
print ========= start dnode4
sql create dnode $hostname4
system sh/exec.sh -n dnode4 -s start
sleep 10000
$x = 0
show3:
$x = $x + 1
sleep
3
000
if $x ==
2
0 then
sleep
1
000
if $x ==
3
0 then
return -1
endi
sql show dnodes -x show3
...
...
@@ -209,13 +243,12 @@ endi
print ============================== step4
print ========= drop dnode3
sql drop dnode $hostname3
sleep 9000
$x = 0
show4:
$x = $x + 1
sleep
3
000
if $x ==
2
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show dnodes -x show4
...
...
@@ -266,12 +299,11 @@ print ============================== step5
print ========= start dnode3
sql create dnode $hostname5
system sh/exec.sh -n dnode5 -s start
sleep 9000
$x = 0
show5:
$x = $x + 1
sleep
2
000
sleep
1
000
if $x == 30 then
return -1
endi
...
...
@@ -304,7 +336,7 @@ print dnode5 ==> $dnode5Role
print ============================== step6
system sh/exec.sh -n dnode1 -s stop -x SIGINT
print stop dnode1 and sleep 10000
sleep
10
000
sleep
5
000
sql drop dnode $hostname1
print drop dnode1 and sleep 9000
...
...
@@ -364,7 +396,7 @@ print ============================== step12
print ========= check data
sql reset query cache
sleep 100
0
sleep 100
sql select * from c_b2_d1.c_b2_t1 order by t desc
print $data01 $data11 $data21 $data31 $data41
...
...
tests/script/unique/cluster/balance3.sim
浏览文件 @
9f4a8ba7
...
...
@@ -7,7 +7,6 @@ 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 numOfMnodes -v 3
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3
...
...
@@ -16,7 +15,6 @@ system sh/cfg.sh -n dnode4 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode5 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode6 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode7 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode8 -c numOfMnodes -v 3
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 0
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 0
...
...
@@ -25,7 +23,6 @@ system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 0
system sh/cfg.sh -n dnode5 -c mnodeEqualVnodeNum -v 0
system sh/cfg.sh -n dnode6 -c mnodeEqualVnodeNum -v 0
system sh/cfg.sh -n dnode7 -c mnodeEqualVnodeNum -v 0
system sh/cfg.sh -n dnode8 -c mnodeEqualVnodeNum -v 0
system sh/cfg.sh -n dnode1 -c wallevel -v 1
system sh/cfg.sh -n dnode2 -c wallevel -v 1
...
...
@@ -34,19 +31,52 @@ system sh/cfg.sh -n dnode4 -c wallevel -v 1
system sh/cfg.sh -n dnode5 -c wallevel -v 1
system sh/cfg.sh -n dnode6 -c wallevel -v 1
system sh/cfg.sh -n dnode7 -c wallevel -v 1
system sh/cfg.sh -n dnode8 -c wallevel -v 1
print ============== step1
print ========= start dnode1
system sh/exec.sh -n dnode1 -s start
sql connect
sleep 2001
sql create dnode $hostname2
sql create dnode $hostname3
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
sleep 3001
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
if $data4_3 != ready then
goto step1
endi
sql show mnodes
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step1
endi
if $data2_2 != slave then
goto step1
endi
if $data2_3 != slave then
goto step1
endi
sql create database c_b3_d1 replica 3
sql use c_b3_d1
...
...
@@ -89,8 +119,6 @@ $dnode2Vnodes = $data2_2
print dnode2 $dnode2Vnodes
$dnode3Vnodes = $data2_3
print dnode3 $dnode3Vnodes
$dnode4Vnodes = $data2_4
print dnode4 $dnode4Vnodes
if $dnode1Vnodes != 3 then
goto show1
...
...
@@ -101,30 +129,22 @@ endi
if $dnode3Vnodes != 3 then
goto show1
endi
if $dnode4Vnodes != null then
goto show1
endi
sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
print dnode4 ==> $data2_4
print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
print ============================== step2
print ========= start dnode4
sql create dnode $hostname4
system sh/exec.sh -n dnode4 -s start
sleep 9000
$x = 0
show2:
$x = $x + 1
sleep
2
000
if $x ==
2
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show dnodes -x show2
...
...
@@ -145,21 +165,16 @@ sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
print dnode4 ==> $data2_4
print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
print ============================== step3
print ========= drop dnode2
sql drop dnode $hostname2
sleep 9000
$x = 0
show3:
$x = $x + 1
sleep
2
000
if $x ==
2
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show dnodes -x show3
...
...
@@ -189,25 +204,21 @@ sql show mnodes
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
print dnode4 ==> $data2_4
print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
system sh/exec.sh -n dnode2 -s stop -x SIGINT
print ============================== step4
sql create dnode $hostname5
system sh/exec.sh -n dnode5 -s start
sleep 10000
$x = 0
show4:
$x = $x + 1
sleep
2
000
if $x ==
2
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show dnodes -x show4
$dnode1Vnodes = $data2_1
print dnode1 $dnode1Vnodes
...
...
@@ -228,8 +239,10 @@ print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
print dnode4 ==> $data2_4
print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
if $data2_4 != slave then
goto show4
endi
print ============================== step5
print ========= drop dnode3
...
...
@@ -239,8 +252,8 @@ sleep 9000
$x = 0
show5:
$x = $x + 1
sleep
2
000
if $x ==
2
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show dnodes -x show5
...
...
@@ -277,16 +290,19 @@ print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
if $data2_5 != slave then
goto show5
endi
print ============================== step6
sql create dnode $hostname6
system sh/exec.sh -n dnode6 -s start
sleep 9000
$x = 0
show6:
$x = $x + 1
sleep
2
000
if $x ==
2
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show dnodes -x show6
...
...
@@ -299,6 +315,15 @@ print dnode5 $dnode5Vnodes
$dnode6Vnodes = $data2_6
print dnode6 $dnode6Vnodes
if $dnode1Vnodes != 2 then
goto show6
endi
if $dnode4Vnodes != 2 then
goto show6
endi
if $dnode5Vnodes != 3 then
goto show6
endi
if $dnode6Vnodes != 2 then
goto show6
endi
...
...
@@ -315,13 +340,12 @@ print dnode7 ==> $data2_7
print ============================== step7
print ========= drop dnode4
sql drop dnode $hostname4
sleep 9000
$x = 0
show7:
$x = $x + 1
sleep
2
000
if $x ==
2
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show dnodes -x show7
...
...
@@ -357,16 +381,19 @@ print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
if $data2_6 != slave then
goto show7
endi
print ============================== step8
sql create dnode $hostname7
system sh/exec.sh -n dnode7 -s start
sleep 9000
$x = 0
show8:
$x = $x + 1
sleep
2
000
if $x ==
2
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show dnodes -x show8
...
...
@@ -379,6 +406,15 @@ print dnode6 $dnode6Vnodes
$dnode7Vnodes = $data2_7
print dnode7 $dnode7Vnodes
if $dnode1Vnodes != 2 then
goto show8
endi
if $dnode5Vnodes != 2 then
goto show8
endi
if $dnode6Vnodes != 3 then
goto show8
endi
if $dnode7Vnodes != 2 then
goto show8
endi
...
...
@@ -393,19 +429,17 @@ print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
print ============================== step9
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
$x = 0
show9:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show mnodes -x show9
sql show mnodes
$dnode1Role = $data2_1
$dnode4Role = $data2_4
$dnode5Role = $data2_5
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
...
...
@@ -414,26 +448,27 @@ print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
if $dnode1Role != offline then
return -1
if $data2_1 != offline then
goto show9
endi
if $data2_5 != master then
goto show9
endi
if $data2_6 != slave then
goto show9
endi
print ============================== step9.1
sleep 2000
system sh/exec.sh -n dnode1 -s start
print ============================== step10
sql drop dnode $hostname1
$x = 0
show
9
:
show
10
:
$x = $x + 1
sleep
2
000
if $x ==
2
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show mnodes -x show10
sql show mnodes
$dnode1Role = $data2_1
$dnode4Role = $data2_4
$dnode5Role = $data2_5
print dnode1 ==> $data2_1
print dnode2 ==> $data2_2
print dnode3 ==> $data2_3
...
...
@@ -442,7 +477,31 @@ print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
sql show dnodes -x show9
if $data2_1 != null then
goto show10
endi
if $data2_5 != master then
goto show10
endi
if $data2_6 != slave then
goto show10
endi
if $data2_7 != slave then
goto show10
endi
print ============================== step11
system sh/exec.sh -n dnode1 -s start
$x = 0
show11:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show dnodes -x show11
$dnode5Vnodes = $data2_5
print dnode5 $dnode5Vnodes
$dnode6Vnodes = $data2_6
...
...
@@ -451,17 +510,16 @@ $dnode7Vnodes = $data2_7
print dnode7 $dnode7Vnodes
if $dnode5Vnodes != 3 then
goto show
9
goto show
11
endi
if $dnode6Vnodes != 3 then
goto show
9
goto show
11
endi
if $dnode7Vnodes != 3 then
goto show
9
goto show
11
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 5000
sql show mnodes
print dnode1 ==> $data2_1
...
...
@@ -472,15 +530,13 @@ print dnode5 ==> $data2_5
print dnode6 ==> $data2_6
print dnode7 ==> $data2_7
print ============================== step11
print ========= add db4
print ============================== step12
sql create database c_b3_d4 replica 3
sql use c_b3_d4
$x = 0
create4:
$x = $x + 1
sleep
2
000
sleep
1
000
if $x == 20 then
return -1
endi
...
...
@@ -491,16 +547,14 @@ sql insert into c_b3_t4 values(1520000022043, 43)
sql insert into c_b3_t4 values(1520000023042, 42)
sql insert into c_b3_t4 values(1520000024041, 41)
sleep 3000
$x = 0
show1
1
:
show1
2
:
$x = $x + 1
sleep
2
000
if $x ==
2
0 then
sleep
1
000
if $x ==
4
0 then
return -1
endi
sql show dnodes -x show1
1
sql show dnodes -x show1
2
$dnode5Vnodes = $data2_5
print dnode5 $dnode5Vnodes
$dnode6Vnodes = $data2_6
...
...
@@ -509,21 +563,18 @@ $dnode7Vnodes = $data2_7
print dnode7 $dnode7Vnodes
if $dnode5Vnodes != 4 then
goto show1
1
goto show1
2
endi
if $dnode6Vnodes != 4 then
goto show1
1
goto show1
2
endi
if $dnode7Vnodes != 4 then
goto show1
1
goto show1
2
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 5000
print ============================== step13
sql reset query cache
sleep
10
00
sleep
2
00
print ========= check data
...
...
@@ -590,4 +641,3 @@ 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/vgroup100.sim
浏览文件 @
9f4a8ba7
...
...
@@ -17,7 +17,6 @@ system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 0
print ============================== step1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print ============================== step2
...
...
@@ -27,8 +26,6 @@ system sh/exec.sh -n dnode2 -s start
sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
sleep 3000
$maxNum = 102
$maxNum = 12
...
...
@@ -92,13 +89,11 @@ print ============================== step5
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
sleep 5000
print ============================== step6
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
sleep 10000
print ============================== step7
...
...
tests/script/unique/db/delete.sim
浏览文件 @
9f4a8ba7
...
...
@@ -18,7 +18,6 @@ system sh/cfg.sh -n dnode3 -c maxTablesPerVnode -v 1000
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
sql create dnode $hostname2
sql create dnode $hostname3
...
...
@@ -38,8 +37,6 @@ while $i < 2000
$i = $i + 1
endw
sleep 2500
sql show db.vgroups
if $rows != 2 then
return -1
...
...
@@ -73,7 +70,6 @@ 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
sleep 5000
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
...
...
@@ -92,7 +88,6 @@ if $data2_1 != master then
goto step3
endi
sleep 1000
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
...
...
tests/script/unique/db/delete_part.sim
浏览文件 @
9f4a8ba7
...
...
@@ -31,11 +31,29 @@ system sh/cfg.sh -n dnode4 -c maxTablesPerVnode -v 4
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
$loop = 0
begin:
...
...
@@ -53,7 +71,6 @@ begin:
sql insert into t13 values(now, 1 )
sql create table t14 (ts timestamp, i int)
sql insert into t14 values(now, 1 )
sleep 1200
sql create table t21 (ts timestamp, i int)
sql insert into t21 values(now, 1 )
...
...
@@ -63,7 +80,6 @@ begin:
sql insert into t23 values(now, 1 )
sql create table t24 (ts timestamp, i int)
sql insert into t24 values(now, 1 )
sleep 1200
sql create table t31 (ts timestamp, i int)
sql insert into t31 values(now, 1 )
...
...
@@ -73,7 +89,6 @@ begin:
sql insert into t33 values(now, 1 )
sql create table t34 (ts timestamp, i int)
sql insert into t34 values(now, 1 )
sleep 1200
sql create table t41 (ts timestamp, i int)
sql insert into t41 values(now, 1 )
...
...
@@ -83,7 +98,6 @@ begin:
sql insert into t43 values(now, 1 )
sql create table t44 (ts timestamp, i int)
sql insert into t44 values(now, 1 )
sleep 1200
sql create table t51 (ts timestamp, i int)
sql insert into t51 values(now, 1 )
...
...
@@ -93,7 +107,6 @@ begin:
sql insert into t53 values(now, 1 )
sql create table t54 (ts timestamp, i int)
sql insert into t54 values(now, 1 )
sleep 1200
sql create table t61 (ts timestamp, i int)
sql insert into t61 values(now, 1 )
...
...
@@ -103,7 +116,6 @@ begin:
sql insert into t63 values(now, 1 )
sql create table t64 (ts timestamp, i int)
sql insert into t64 values(now, 1 )
sleep 1200
sql create table t71 (ts timestamp, i int)
sql insert into t71 values(now, 1 )
...
...
@@ -113,7 +125,6 @@ begin:
sql insert into t73 values(now, 1 )
sql create table t74 (ts timestamp, i int)
sql insert into t74 values(now, 1 )
sleep 1200
sql create table t81 (ts timestamp, i int)
sql insert into t81 values(now, 1 )
...
...
@@ -123,7 +134,6 @@ begin:
sql insert into t83 values(now, 1 )
sql create table t84 (ts timestamp, i int)
sql insert into t84 values(now, 1 )
sleep 1200
sql show dnodes
print dnode1 openVnodes $data2_1
...
...
@@ -138,29 +148,36 @@ begin:
print ======== step2 $loop
system sh/exec.sh -n dnode2 -s stop
sleep 1000
print ==> drop database $db
sql drop database $db
print ======== step3 $loop
sleep 2000
system sh/exec.sh -n dnode2 -s start
sleep 15000
sql show dnodes
$x = 0
step3:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes -x step3
print dnode1 openVnodes $data2_1 $data4_1
print dnode2 openVnodes $data2_2 $data4_2
if $data2_1 != 0 then
return -1
goto step3
endi
if $data2_2 != 0 then
return -1
goto step3
endi
if $data4_1 != ready then
return -1
goto step3
endi
if $data4_2 != ready then
return -1
goto step3
endi
print ===> test times : $loop
...
...
@@ -171,7 +188,7 @@ begin:
$loop = $loop + 1
sql reset query cache
sleep 100
0
sleep 100
goto begin
...
...
tests/script/unique/db/replica_add12.sim
浏览文件 @
9f4a8ba7
...
...
@@ -20,6 +20,11 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c balanceInterval -v 1
system sh/cfg.sh -n dnode2 -c balanceInterval -v 1
system sh/cfg.sh -n dnode3 -c balanceInterval -v 1
system sh/cfg.sh -n dnode4 -c balanceInterval -v 1
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sql connect
...
...
@@ -27,7 +32,43 @@ sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
sleep 3000
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
if $data4_3 != ready then
goto step1
endi
sql show mnodes
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step1
endi
if $data2_2 != null then
goto step1
endi
if $data2_3 != null then
goto step1
endi
print ======== step1
sql create database d1 replica 1
...
...
@@ -65,8 +106,6 @@ if $rows != 1 then
return -1
endi
sleep 2000
sql show dnodes
print dnode1 ==> openVnodes: $data2_1
print dnode2 ==> openVnodes: $data2_2
...
...
@@ -89,10 +128,40 @@ sql alter database d1 replica 2
sql alter database d2 replica 2
sql alter database d3 replica 2
sql alter database d4 replica 2
sleep 10000
$x = 0
a1:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 2 then
goto a1
endi
sql show d2.vgroups
print online vnodes $data03
if $data03 != 2 then
goto a1
endi
sql show d3.vgroups
print online vnodes $data03
if $data03 != 2 then
goto a1
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 2 then
goto a1
endi
print ======== step3
sql show dnodes
print dnode1 ==> openVnodes: $data2_1
print dnode2 ==> openVnodes: $data2_2
...
...
@@ -115,7 +184,6 @@ sql insert into d1.t1 values(now, 2)
sql insert into d2.t2 values(now, 2)
sql insert into d3.t3 values(now, 2)
sql insert into d4.t4 values(now, 2)
sleep 1000
sql select * from d1.t1
if $rows != 2 then
...
...
@@ -138,33 +206,54 @@ if $rows != 2 then
endi
sql reset query cache
sleep 200
0
sleep 200
print ========= step5
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 5000
sql select * from d1.t1 -x s51
s51:
#sql insert into d1.t1 values(now, 3) -x s52
s52:
sql_error select * from d1.t1
sql_error select * from d2.t2
sql_error select * from d3.t3
sql_error select * from d4.t4
print ========= step6
system sh/exec.sh -n dnode2 -s start
$x = 0
step6:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step6
endi
print ===== insert data
sql show d2.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step6
endi
sql
_error insert into d1.t1 values(now, 3)
sql_error insert into d2.t2 values(now, 3)
sql_error insert into d3.t3 values(now, 3)
sql_error insert into d4.t4 values(now, 3)
sleep 1000
sql
show d3.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step6
endi
print ========= step6
system sh/exec.sh -n dnode2 -s start
sleep 5000
sql show d4.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step6
endi
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 step6
sql insert into d2.t2 values(now, 3)
-x step6
sql insert into d3.t3 values(now, 3)
-x step6
sql insert into d4.t4 values(now, 3)
-x step6
sql select * from d1.t1
if $rows != 3 then
...
...
@@ -187,30 +276,52 @@ if $rows != 3 then
endi
print ========= step61
system sh/exec.sh -n dnode3 -s stop -x SIGINT
sleep 5000
sql_error insert into d1.t1 values(now, 3)
sql_error insert into d2.t2 values(now, 3)
sql_error insert into d3.t3 values(now, 3)
sql_error insert into d4.t4 values(now, 3)
sleep 1000
#sql insert into d1.t1 values(now, 3) -x s61
s61:
sql_error select * from d1.t1
sql_error select * from d2.t2
sql_error select * from d3.t3
sql_error select * from d4.t4
sql select * from d2.t2 -x s62
s62:
print ========= step7
system sh/exec.sh -n dnode3 -s start
sleep 5000
sql insert into d1.t1 values(now, 5)
sql insert into d2.t2 values(now, 5)
sql insert into d3.t3 values(now, 5)
sql insert into d4.t4 values(now, 5)
sleep 1000
$x = 0
step7:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step7
endi
sql show d2.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step7
endi
sql show d3.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step7
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step7
endi
sql insert into d1.t1 values(now, 5) -x step7
sql insert into d2.t2 values(now, 5) -x step7
sql insert into d3.t3 values(now, 5) -x step7
sql insert into d4.t4 values(now, 5) -x step7
sql select * from d1.t1
if $rows != 4 then
...
...
@@ -235,8 +346,4 @@ endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode4 -s stop -x SIGINT
\ No newline at end of file
tests/script/unique/db/replica_add13.sim
浏览文件 @
9f4a8ba7
...
...
@@ -20,6 +20,11 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c balanceInterval -v 1
system sh/cfg.sh -n dnode2 -c balanceInterval -v 1
system sh/cfg.sh -n dnode3 -c balanceInterval -v 1
system sh/cfg.sh -n dnode4 -c balanceInterval -v 1
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sql connect
...
...
@@ -29,7 +34,41 @@ sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
sql create dnode $hostname4
system sh/exec.sh -n dnode4 -s start
sleep 3000
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
print dnode4 $data4_4
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
if $data4_3 != ready then
goto step1
endi
if $data4_4 != ready then
goto step1
endi
sql show mnodes
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step1
endi
print ======== step1
sql create database d1 replica 1
...
...
@@ -46,7 +85,6 @@ sql insert into d1.t1 values(1589529000011, 1)
sql insert into d2.t2 values(1589529000021, 1)
sql insert into d3.t3 values(1589529000031, 1)
sql insert into d4.t4 values(1589529000041, 1)
sleep 1000
sql select * from d1.t1
if $rows != 1 then
...
...
@@ -73,17 +111,40 @@ sql alter database d1 replica 3
sql alter database d2 replica 3
sql alter database d3 replica 3
sql alter database d4 replica 3
sleep 10000
print ======== step3
$x = 0
show3
:
a1
:
$x = $x + 1
sleep
2
000
if $x ==
10 then
return -1
sleep
1
000
if $x ==
40 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 3 then
goto a1
endi
sql show d2.vgroups
print online vnodes $data03
if $data03 != 3 then
goto a1
endi
sql show d3.vgroups
print online vnodes $data03
if $data03 != 3 then
goto a1
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 3 then
goto a1
endi
print ======== step3
sql show dnodes
print dnode1 ==> openVnodes: $data2_1
print dnode2 ==> openVnodes: $data2_2
...
...
@@ -111,7 +172,6 @@ sql insert into d1.t1 values(1589529000012, 2)
sql insert into d2.t2 values(1589529000022, 2)
sql insert into d3.t3 values(1589529000032, 2)
sql insert into d4.t4 values(1589529000042, 2)
sleep 1000
sql select * from d1.t1
if $rows != 2 then
...
...
@@ -135,15 +195,13 @@ endi
print ========= step5
sql reset query cache
sleep 100
0
sleep 100
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 5000
sql insert into d1.t1 values(1589529000013, 3)
sql insert into d2.t2 values(1589529000023, 3)
sql insert into d3.t3 values(1589529000033, 3)
sql insert into d4.t4 values(1589529000043, 3)
sleep 1000
sql select * from d1.t1
if $rows != 3 then
...
...
@@ -167,15 +225,45 @@ endi
print ========= step6
system sh/exec.sh -n dnode2 -s start
sleep 5000
$x = 0
step6:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step6
endi
sql show d2.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step6
endi
sql show d3.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step6
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step6
endi
system sh/exec.sh -n dnode3 -s stop -x SIGINT
sleep 5000
sql insert into d1.t1 values(1589529000014, 4)
sql insert into d2.t2 values(1589529000024, 4)
sql insert into d3.t3 values(1589529000034, 4)
sql insert into d4.t4 values(1589529000044, 4)
sleep 1000
sql select * from d1.t1
print select * from d1.t1 $rows
...
...
@@ -203,15 +291,45 @@ endi
print ========= step7
system sh/exec.sh -n dnode3 -s start
sleep 5000
$x = 0
step7:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step7
endi
sql show d2.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step7
endi
sql show d3.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step7
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step7
endi
system sh/exec.sh -n dnode4 -s stop -x SIGINT
sleep 5000
sql insert into d1.t1 values(1589529000015, 5)
sql insert into d2.t2 values(1589529000025, 5)
sql insert into d3.t3 values(1589529000035, 5)
sql insert into d4.t4 values(1589529000045, 5)
sleep 1000
sql select * from d1.t1
if $rows != 5 then
...
...
@@ -235,15 +353,45 @@ endi
print ========= step8
system sh/exec.sh -n dnode4 -s start
sleep 5000
$x = 0
step8:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step8
endi
sql show d2.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step8
endi
sql show d3.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step8
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step8
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 5000
sql insert into d1.t1 values(1589529000016, 6)
sql insert into d2.t2 values(1589529000026, 6)
sql insert into d3.t3 values(1589529000036, 6)
sql insert into d4.t4 values(1589529000046, 6)
sleep 1000
sql select * from d1.t1
if $rows != 6 then
...
...
@@ -268,8 +416,4 @@ endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode4 -s stop -x SIGINT
\ No newline at end of file
tests/script/unique/db/replica_add23.sim
浏览文件 @
9f4a8ba7
...
...
@@ -20,6 +20,11 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c balanceInterval -v 1
system sh/cfg.sh -n dnode2 -c balanceInterval -v 1
system sh/cfg.sh -n dnode3 -c balanceInterval -v 1
system sh/cfg.sh -n dnode4 -c balanceInterval -v 1
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sql connect
...
...
@@ -29,7 +34,42 @@ sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
sql create dnode $hostname4
system sh/exec.sh -n dnode4 -s start
sleep 3000
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
print dnode4 $data4_4
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
if $data4_3 != ready then
goto step1
endi
if $data4_4 != ready then
goto step1
endi
sql show mnodes
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step1
endi
print ======== step1
sql create database d1 replica 2
...
...
@@ -46,7 +86,6 @@ sql insert into d1.t1 values(1588262400001, 1)
sql insert into d2.t2 values(1588262400001, 1)
sql insert into d3.t3 values(1588262400001, 1)
sql insert into d4.t4 values(1588262400001, 1)
sleep 1000
sql select * from d1.t1
if $rows != 1 then
...
...
@@ -73,17 +112,40 @@ sql alter database d1 replica 3
sql alter database d2 replica 3
sql alter database d3 replica 3
sql alter database d4 replica 3
sleep 10000
print ======== step3
$x = 0
show3
:
a1
:
$x = $x + 1
sleep
2
000
if $x ==
10 then
return -1
sleep
1
000
if $x ==
40 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 3 then
goto a1
endi
sql show d2.vgroups
print online vnodes $data03
if $data03 != 3 then
goto a1
endi
sql show d3.vgroups
print online vnodes $data03
if $data03 != 3 then
goto a1
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 3 then
goto a1
endi
print ======== step3
sql show dnodes
print dnode1 ==> openVnodes: $data2_1
print dnode2 ==> openVnodes: $data2_2
...
...
@@ -111,7 +173,6 @@ sql insert into d1.t1 values(1588262400002, 2)
sql insert into d2.t2 values(1588262400002, 2)
sql insert into d3.t3 values(1588262400002, 2)
sql insert into d4.t4 values(1588262400002, 2)
sleep 1000
sql select * from d1.t1
if $rows != 2 then
...
...
@@ -134,17 +195,14 @@ if $rows != 2 then
endi
sql reset query cache
sleep 100
0
sleep 100
print ========= step5
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 5000
sql insert into d1.t1 values(1588262400003, 3)
sql insert into d2.t2 values(1588262400003, 3)
sql insert into d3.t3 values(1588262400003, 3)
sql insert into d4.t4 values(1588262400003, 3)
sleep 1000
sql select * from d1.t1
if $rows != 3 then
...
...
@@ -168,15 +226,45 @@ endi
print ========= step6
system sh/exec.sh -n dnode2 -s start
sleep 5000
$x = 0
step6:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step6
endi
sql show d2.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step6
endi
sql show d3.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step6
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step6
endi
system sh/exec.sh -n dnode3 -s stop -x SIGINT
sleep 5000
sql insert into d1.t1 values(1588262400004, 4)
sql insert into d2.t2 values(1588262400004, 4)
sql insert into d3.t3 values(1588262400004, 4)
sql insert into d4.t4 values(1588262400004, 4)
sleep 1000
sql select * from d1.t1
if $rows != 4 then
...
...
@@ -200,15 +288,45 @@ endi
print ========= step7
system sh/exec.sh -n dnode3 -s start
sleep 5000
$x = 0
step7:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step7
endi
sql show d2.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step7
endi
sql show d3.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step7
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step7
endi
system sh/exec.sh -n dnode4 -s stop -x SIGINT
sleep 5000
sql insert into d1.t1 values(1588262400005, 5)
sql insert into d2.t2 values(1588262400005, 5)
sql insert into d3.t3 values(1588262400005, 5)
sql insert into d4.t4 values(1588262400005, 5)
sleep 1000
sql select * from d1.t1
if $rows != 5 then
...
...
@@ -232,15 +350,45 @@ endi
print ========= step8
system sh/exec.sh -n dnode4 -s start
sleep 5000
$x = 0
step8:
$x = $x + 1
sleep 2000
if $x == 10 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step8
endi
sql show d2.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step8
endi
sql show d3.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step8
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 3 then
goto step8
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 5000
sql insert into d1.t1 values(1588262400006, 6)
sql insert into d2.t2 values(1588262400006, 6)
sql insert into d3.t3 values(1588262400006, 6)
sql insert into d4.t4 values(1588262400006, 6)
sleep 1000
sql select * from d1.t1
if $rows != 6 then
...
...
@@ -265,8 +413,4 @@ endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode4 -s stop -x SIGINT
\ No newline at end of file
tests/script/unique/db/replica_part.sim
浏览文件 @
9f4a8ba7
...
...
@@ -14,6 +14,10 @@ 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
system sh/cfg.sh -n dnode1 -c balanceInterval -v 1
system sh/cfg.sh -n dnode2 -c balanceInterval -v 1
system sh/cfg.sh -n dnode3 -c balanceInterval -v 1
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sql connect
...
...
@@ -21,7 +25,38 @@ sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
sql create dnode $hostname3
system sh/exec.sh -n dnode3 -s start
sleep 3000
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
print dnode3 $data4_3
print dnode4 $data4_4
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
if $data4_3 != ready then
goto step1
endi
sql show mnodes
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
goto step1
endi
print ======== step1
sql create database d1 replica 3
...
...
@@ -38,7 +73,6 @@ sql insert into d2.t2 values(now, 1)
sql insert into d1.t1 values(now, 1)
sql insert into d3.t3 values(now, 1)
sql insert into d4.t4 values(now, 1)
sleep 1000
sql select * from d1.t1
if $rows != 1 then
...
...
@@ -61,24 +95,85 @@ if $rows != 1 then
endi
print ========= step2 alter db
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 5000
sql alter database d1 replica 2
sql alter database d2 replica 2
sql alter database d3 replica 2
sql alter database d4 replica 2
sleep 5000
$x = 0
a1:
$x = $x + 1
sleep 1000
if $x == 40 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 2 then
goto a1
endi
sql show d2.vgroups
print online vnodes $data03
if $data03 != 2 then
goto a1
endi
sql show d3.vgroups
print online vnodes $data03
if $data03 != 2 then
goto a1
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 2 then
goto a1
endi
system sh/exec.sh -n dnode2 -s stop -x SIGINT
print ========= step3
system sh/exec.sh -n dnode2 -s start
sleep 10000
$x = 0
step3:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step3
endi
sql show d2.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step3
endi
sql show d3.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step3
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step3
endi
print ========= step4
sql insert into d1.t1 values(now, 2)
sql insert into d2.t2 values(now, 2)
sql insert into d3.t3 values(now, 2)
sql insert into d4.t4 values(now, 2)
sleep 1000
sql select * from d1.t1
if $rows != 2 then
...
...
@@ -102,44 +197,104 @@ endi
print ========= step5
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 5000
sql reset query cache
sleep 100
0
sleep 100
sql insert into d1.t1 values(now, 3) -x s1
s1:
sql insert into d2.t2 values(now, 3) -x s2
s2:
sql insert into d3.t3 values(now, 3) -x s3
s3:
sql insert into d4.t4 values(now, 3) -x s4
s4:
#
sql insert into d2.t2 values(now, 3) -x s2
#
s2:
#
sql insert into d3.t3 values(now, 3) -x s3
#
s3:
#
sql insert into d4.t4 values(now, 3) -x s4
#
s4:
print ========= step6
system sh/exec.sh -n dnode2 -s start
sleep 5000
$x = 0
step6:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step6
endi
sql show d2.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step6
endi
sql show d3.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step6
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step6
endi
system sh/exec.sh -n dnode3 -s stop -x SIGINT
sleep 5000
sql insert into d1.t1 values(now, 4) -x s5
s5:
#
sql insert into d1.t1 values(now, 4) -x s5
#
s5:
sql insert into d2.t2 values(now, 4) -x s6
s6:
sql insert into d3.t3 values(now, 4) -x s7
s7:
sql insert into d4.t4 values(now, 4) -x s8
s8:
#
sql insert into d3.t3 values(now, 4) -x s7
#
s7:
#
sql insert into d4.t4 values(now, 4) -x s8
#
s8:
print ========= step7
system sh/exec.sh -n dnode3 -s start
sleep 5000
$x = 0
step7:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step7
endi
sql show d2.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step7
endi
sql show d3.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step7
endi
sql show d4.vgroups
print online vnodes $data03
if $data03 != 2 then
goto step7
endi
sql insert into d1.t1 values(now, 5)
sql insert into d2.t2 values(now, 5)
sql insert into d3.t3 values(now, 5)
sql insert into d4.t4 values(now, 5)
sleep 1000
sql select * from d1.t1
sql select * from d2.t2
...
...
@@ -148,9 +303,4 @@ sql select * from d4.t4
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
\ No newline at end of file
system sh/exec.sh -n dnode3 -s stop -x SIGINT
\ No newline at end of file
tests/script/unique/db/replica_reduce21.sim
浏览文件 @
9f4a8ba7
...
...
@@ -14,12 +14,42 @@ 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
system sh/cfg.sh -n dnode1 -c balanceInterval -v 1
system sh/cfg.sh -n dnode2 -c balanceInterval -v 1
system sh/cfg.sh -n dnode3 -c balanceInterval -v 1
system sh/cfg.sh -n dnode4 -c balanceInterval -v 1
print ========= start dnodes
system sh/exec.sh -n dnode1 -s start
sql connect
sql create dnode $hostname2
system sh/exec.sh -n dnode2 -s start
sleep 3000
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
print dnode1 $data4_1
print dnode2 $data4_2
if $data4_1 != ready then
goto step1
endi
if $data4_2 != ready then
goto step1
endi
sql show mnodes
print mnode1 $data2_1
print mnode1 $data2_2
if $data2_1 != master then
goto step1
endi
print ======== step1
sql create database d1 replica 2
...
...
@@ -63,12 +93,25 @@ sql create database d5 replica 1
print ========= step3 alter d1
sql alter database d1 replica 1
sleep 12000
$x = 0
a1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql show d1.vgroups
print online vnodes $data03
if $data03 != 1 then
goto a1
endi
print ========= step4 query d1
sql insert into d1.t1 values(now, 2)
sql select * from d1.t1
sleep 1000
if $rows != 2 then
return -1
endi
...
...
@@ -77,22 +120,20 @@ print ========= step5 query d5
sql create table d5.t5 (ts timestamp, i int)
sql insert into d5.t5 values(now, 1);
sql select * from d5.t5
sleep 1000
if $rows != 1 then
return -1
endi
return
print ========= step7 drop d1
sql drop database d1
sleep 5000
sql reset query cache
sleep 100
print ========= step8
sql insert into d5.t5 values(now, 2)
sql insert into d2.t2 values(now, 2)
sql insert into d3.t3 values(now, 2)
sql insert into d4.t4 values(now, 2)
sleep 1000
sql select * from d5.t5
if $rows != 2 then
...
...
@@ -116,13 +157,11 @@ endi
print ======== step9 stop dnode2
system sh/exec.sh -n dnode2 -s stop -x SIGINT
sleep 5000
sql insert into d5.t5 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)
sleep 1000
sql select * from d5.t5
if $rows != 3 then
...
...
@@ -145,10 +184,4 @@ if $rows != 3 then
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode5 -s stop -x SIGINT
system sh/exec.sh -n dnode6 -s stop -x SIGINT
system sh/exec.sh -n dnode7 -s stop -x SIGINT
system sh/exec.sh -n dnode8 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode2 -s stop -x SIGINT
\ No newline at end of file
tests/script/unique/db/replica_reduce31.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/db/replica_reduce32.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/dnode/balance1.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/dnode/balance2.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/dnode/balance3.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/dnode/offline3.sim
0 → 100644
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/dnode/reason.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/dnode/remove1.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/dnode/remove2.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/dnode/vnode_clean.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/import/replica2.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/import/replica3.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/mnode/mgmt20.sim
浏览文件 @
9f4a8ba7
...
...
@@ -11,7 +11,6 @@ system sh/cfg.sh -n dnode2 -c monitor -v 1
print ============== step1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
sleep 3000
sql connect
print ============== step2
...
...
@@ -20,8 +19,8 @@ sql create dnode $hostname2
$x = 0
show2:
$x = $x + 1
sleep
2
000
if $x ==
1
0 then
sleep
1
000
if $x ==
2
0 then
return -1
endi
...
...
tests/script/unique/mnode/mgmt22.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/mnode/mgmt23.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/mnode/mgmt33.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/mnode/mgmt34.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/mnode/mgmtr2.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/vnode/many.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/vnode/replica2_repeat.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/vnode/replica3_basic.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
tests/script/unique/vnode/replica3_repeat.sim
浏览文件 @
9f4a8ba7
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录