提交 998a7416 编写于 作者: S slguan

[TD-184]

上级 3d2fdee8
......@@ -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);
......
......@@ -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
......
......@@ -66,12 +66,12 @@ endi
print ========= step2 alter db
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
sleep 3000
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 3000
sleep 5000
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
......@@ -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 12000
sleep 8000
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
......@@ -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
......@@ -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.
先完成此消息的编辑!
想要评论请 注册