Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
998a7416
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
998a7416
编写于
4月 28, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-184]
上级
3d2fdee8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
76 addition
and
187 deletion
+76
-187
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+6
-3
tests/script/sh/exec_up.sh
tests/script/sh/exec_up.sh
+6
-15
tests/script/unique/db/replica_part.sim
tests/script/unique/db/replica_part.sim
+22
-69
tests/script/unique/db/replica_reduce31.sim
tests/script/unique/db/replica_reduce31.sim
+32
-70
tests/script/unique/db/replica_reduce32.sim
tests/script/unique/db/replica_reduce32.sim
+9
-29
tests/script/unique/db/testSuite.sim
tests/script/unique/db/testSuite.sim
+1
-1
未找到文件。
src/vnode/src/vnodeMain.c
浏览文件 @
998a7416
...
...
@@ -311,7 +311,7 @@ void *vnodeGetWqueue(int32_t vgId) {
SVnodeObj
*
pVnode
=
vnodeAccquireVnode
(
vgId
);
if
(
pVnode
==
NULL
)
return
NULL
;
return
pVnode
->
wqueue
;
}
}
void
*
vnodeGetWal
(
void
*
pVnode
)
{
return
((
SVnodeObj
*
)
pVnode
)
->
wal
;
...
...
@@ -341,10 +341,13 @@ static void vnodeBuildVloadMsg(char *pNode, void * param) {
}
static
void
vnodeCleanUp
(
SVnodeObj
*
pVnode
)
{
taosDeleteIntHash
(
tsDnodeVnodesHash
,
pVnode
->
vgId
);
//syncStop(pVnode->sync);
if
(
pVnode
->
sync
)
{
syncStop
(
pVnode
->
sync
);
pVnode
->
sync
=
NULL
;
}
tsdbCloseRepo
(
pVnode
->
tsdb
);
walClose
(
pVnode
->
wal
);
vnodeSaveVersion
(
pVnode
);
...
...
tests/script/sh/exec_up.sh
浏览文件 @
998a7416
...
...
@@ -70,24 +70,15 @@ if [ "$CLEAR_OPTION" = "clear" ]; then
rm
-rf
$MGMT_DIR
fi
if
[
"
$SHELL_OPTION
"
=
"true"
]
;
then
if
[
"
$EXEC_OPTON
"
=
"start"
]
;
then
echo
"ExcuteCmd:"
$EXE_DIR
/taos
-c
$CFG_DIR
-u
$USERS
-p
$EXE_DIR
/taos
-c
$CFG_DIR
-u
$USERS
-p
if
[
"
$EXEC_OPTON
"
=
"start"
]
;
then
echo
"ExcuteCmd:"
$EXE_DIR
/taosd
-c
$CFG_DIR
if
[
"
$SHELL_OPTION
"
=
"true"
]
;
then
nohup
valgrind
--log-file
=
${
LOG_DIR
}
/valgrind.log
--tool
=
memcheck
--leak-check
=
full
--show-reachable
=
no
--track-origins
=
yes
--show-leak-kinds
=
all
-v
--workaround-gcc296-bugs
=
yes
$EXE_DIR
/taosd
-c
$CFG_DIR
>
/dev/null 2>&1 &
else
#relative path
RCFG_DIR
=
sim/
$NODE_NAME
/cfg
PID
=
`
ps
-ef
|grep
-v
taosd |
grep
taos |
grep
$RCFG_DIR
|
grep
-v
grep
|
awk
'{print $2}'
`
if
[
-n
"
$PID
"
]
;
then
sudo kill
-9
$PID
fi
nohup
$EXE_DIR
/taosd
-c
$CFG_DIR
>
/dev/null 2>&1 &
fi
return
fi
if
[
"
$EXEC_OPTON
"
=
"start"
]
;
then
echo
"ExcuteCmd:"
$EXE_DIR
/taosd
-c
$CFG_DIR
nohup
$EXE_DIR
/taosd
-c
$CFG_DIR
>
/dev/null 2>&1 &
#TT=`date +%s`
#mkdir ${LOG_DIR}/${TT}
#echo valgrind --log-file=${LOG_DIR}/${TT}/valgrind.log --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes $EXE_DIR/taosd -c $CFG_DIR
...
...
tests/script/unique/db/replica_part.sim
浏览文件 @
998a7416
...
...
@@ -66,12 +66,12 @@ endi
print ========= step2 alter db
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
sleep
3
000
sleep
5
000
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
3
000
sleep
5
000
print ========= step3
system sh/exec_up.sh -n dnode2 -s start
...
...
@@ -105,69 +105,38 @@ endi
print ========= step5
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
sleep 3000
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 select * from d1.t1
if $rows != 3 then
return -1
endi
sql select * from d2.t2
if $rows != 3 then
return -1
endi
sleep 5000
sql select * from d3.t3
if $rows != 3 then
return -1
endi
sql reset query cache
sleep 1000
sql select * from d4.t4
if $rows != 3 then
return -1
endi
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:
print ========= step6
system sh/exec_up.sh -n dnode2 -s start
sleep 5000
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
sleep 3000
sql insert into d1.t1 values(now, 4)
sql insert into d2.t2 values(now, 4)
sql insert into d3.t3 values(now, 4)
sql insert into d4.t4 values(now, 4)
sql select * from d1.t1
if $rows != 4 then
return -1
endi
sql select * from d2.t2
if $rows != 4 then
return -1
endi
sql select * from d3.t3
if $rows != 4 then
return -1
endi
sleep 5000
sql select * from d4.t4
if $rows != 4 then
return -1
endi
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:
print ========= step7
system sh/exec_up.sh -n dnode3 -s start
sleep 5000
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
sleep 3000
sql insert into d1.t1 values(now, 5)
sql insert into d2.t2 values(now, 5)
...
...
@@ -175,22 +144,6 @@ sql insert into d3.t3 values(now, 5)
sql insert into d4.t4 values(now, 5)
sql select * from d1.t1
if $rows != 5 then
return -1
endi
sql select * from d2.t2
if $rows != 5 then
return -1
endi
sql select * from d3.t3
if $rows != 5 then
return -1
endi
sql select * from d4.t4
if $rows != 5 then
return -1
endi
tests/script/unique/db/replica_reduce31.sim
浏览文件 @
998a7416
...
...
@@ -72,9 +72,18 @@ sql alter database d1 replica 2
sql alter database d2 replica 2
sql alter database d3 replica 2
sleep 12000
sleep 8000
sql alter database d1 replica 1
sql alter database d2 replica 1
sql alter database d3 replica 1
sleep 8000
print ========= step3
sql reset query cache
sleep 1000
sql insert into d1.t1 values(now, 2)
sql insert into d2.t2 values(now, 2)
sql insert into d3.t3 values(now, 2)
...
...
@@ -104,7 +113,7 @@ print ========= step4 alter db
sql alter database d1 replica 2
sql alter database d2 replica 2
sql alter database d3 replica 2
sleep
12
000
sleep
8
000
sql insert into d1.t1 values(now, 3)
sql insert into d2.t2 values(now, 3)
...
...
@@ -133,92 +142,45 @@ endi
print ========= step4
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
sleep 3000
sql insert into d1.t1 values(now, 4)
sql insert into d2.t2 values(now, 4)
sql insert into d3.t3 values(now, 4)
sql insert into d4.t4 values(now, 4)
sql select * from d1.t1
if $rows != 4 then
return -1
endi
sql select * from d2.t2
if $rows != 4 then
return -1
endi
sql select * from d3.t3
if $rows != 4 then
return -1
endi
sleep 5000
sql select * from d4.t4
if $rows != 4 then
return -1
endi
sql reset query cache
sleep 1000
sql insert into d1.t1 values(now, 4) -x step1
step1:
sql insert into d2.t2 values(now, 4) -x step2
step2:
sql insert into d3.t3 values(now, 4) -x step3
step3:
sql insert into d4.t4 values(now, 4) -x step4
step4:
print ========= step5
system sh/exec_up.sh -n dnode2 -s start
sleep 5000
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
sleep 3000
sql insert into d1.t1 values(now, 5)
sql insert into d2.t2 values(now, 5)
sql insert into d3.t3 values(now, 5)
sql insert into d4.t4 values(now, 5)
sql select * from d1.t1
if $rows != 5 then
return -1
endi
sql select * from d2.t2
if $rows != 5 then
return -1
endi
sql select * from d3.t3
if $rows != 5 then
return -1
endi
sql select * from d4.t4
if $rows != 5 then
return -1
endi
sleep 5000
sql insert into d1.t1 values(now, 5) -x step5
step5:
sql insert into d2.t2 values(now, 5) -x step6
step6:
sql insert into d3.t3 values(now, 5) -x step7
step7:
sql insert into d4.t4 values(now, 5) -x step8
step8:
print ========= step6
system sh/exec_up.sh -n dnode3 -s start
sleep 5000
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
sleep 3000
sql insert into d1.t1 values(now, 6)
sql insert into d2.t2 values(now, 6)
sql insert into d3.t3 values(now, 6)
sql insert into d4.t4 values(now, 6)
sql select * from d1.t1
if $rows != 6 then
return -1
endi
sql select * from d2.t2
if $rows != 6 then
return -1
endi
sql select * from d3.t3
if $rows != 6 then
return -1
endi
sql select * from d4.t4
if $rows != 6 then
return -1
endi
tests/script/unique/db/replica_reduce32.sim
浏览文件 @
998a7416
...
...
@@ -96,7 +96,6 @@ sql select * from d4.t4
if $rows != 2 then
return -1
endi
return
print ========= step4
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
...
...
@@ -129,6 +128,7 @@ endi
print ========= step5
system sh/exec_up.sh -n dnode2 -s start
sleep 5000
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
sleep 5000
...
...
@@ -136,30 +136,10 @@ sleep 5000
sql reset query cache
sleep 1000
sql insert into d1.t1 values(now, 4)
sql insert into d2.t2 values(now, 4)
sql insert into d3.t3 values(now, 4)
sql insert into d4.t4 values(now, 4)
sql select * from d1.t1
if $rows != 4 then
return -1
endi
sql select * from d2.t2
if $rows != 4 then
return -1
endi
sql select * from d3.t3
if $rows != 4 then
return -1
endi
sql select * from d4.t4
if $rows != 4 then
return -1
endi
sql_error insert into d1.t1 values(now, 4)
sql_error insert into d2.t2 values(now, 4)
sql_error insert into d3.t3 values(now, 4)
sql_error insert into d4.t4 values(now, 4)
print ========= step6
system sh/exec_up.sh -n dnode3 -s start
...
...
@@ -173,21 +153,21 @@ sql insert into d3.t3 values(now, 5)
sql insert into d4.t4 values(now, 5)
sql select * from d1.t1
if $rows !=
5
then
if $rows !=
4
then
return -1
endi
sql select * from d2.t2
if $rows !=
5
then
if $rows !=
4
then
return -1
endi
sql select * from d3.t3
if $rows !=
5
then
if $rows !=
4
then
return -1
endi
sql select * from d4.t4
if $rows !=
5
then
if $rows !=
4
then
return -1
endi
tests/script/unique/db/testSuite.sim
浏览文件 @
998a7416
...
...
@@ -6,5 +6,5 @@ run unique/db/replica_add23.sim
run unique/db/replica_reduce21.sim
run unique/db/replica_reduce32.sim
run unique/db/replica_reduce31.sim
#
run unique/db/replica_part.sim
run unique/db/replica_part.sim
#run unique/db/delete_part.sim
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录