diff --git a/src/common/src/tdataformat.c b/src/common/src/tdataformat.c index 12ea4ad78d18a5f2b09daabb71093c153d30aca7..719d80aa775bf3b5abe3065ef7eca799d452e315 100644 --- a/src/common/src/tdataformat.c +++ b/src/common/src/tdataformat.c @@ -318,7 +318,7 @@ SDataCols *tdNewDataCols(int maxRowSize, int maxCols, int maxRows) { pCols->maxPoints = maxRows; pCols->bufSize = maxRowSize * maxRows; - pCols->buf = malloc(pCols->bufSize); + pCols->buf = calloc(1, pCols->bufSize); if (pCols->buf == NULL) { free(pCols); return NULL; diff --git a/tests/script/sh/deploy.sh b/tests/script/sh/deploy.sh index 445baa9e45326e895d75489262217f9d3f938606..b9a9e4f02460717e04d4ba4f6347f9bab666207b 100755 --- a/tests/script/sh/deploy.sh +++ b/tests/script/sh/deploy.sh @@ -136,6 +136,8 @@ echo "defaultPass taosdata" >> $TAOS_CFG echo "numOfLogLines 20000000" >> $TAOS_CFG echo "mnodeEqualVnodeNum 0" >> $TAOS_CFG echo "clog 2" >> $TAOS_CFG +#echo "cache 1" >> $TAOS_CFG +#echo "block 2" >> $TAOS_CFG echo "statusInterval 1" >> $TAOS_CFG echo "numOfTotalVnodes 4" >> $TAOS_CFG echo "maxVgroupsPerDb 4" >> $TAOS_CFG diff --git a/tests/script/sh/exec.sh b/tests/script/sh/exec.sh index 6928039be11642b82e9a50d2f32a38d442abfbce..2f294075a1695298cb52b53bc52e11d9dce9fe07 100755 --- a/tests/script/sh/exec.sh +++ b/tests/script/sh/exec.sh @@ -88,7 +88,9 @@ 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 & + TT=`date +%s` + mkdir ${LOG_DIR}/${TT} + nohup 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 > /dev/null 2>&1 & else nohup $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 & fi diff --git a/tests/script/unique/vnode/replica2_a_large.sim b/tests/script/unique/vnode/replica2_a_large.sim new file mode 100644 index 0000000000000000000000000000000000000000..801570dd9c18daa5611d621660e88905fa73c2b3 --- /dev/null +++ b/tests/script/unique/vnode/replica2_a_large.sim @@ -0,0 +1,103 @@ +system sh/stop_dnodes.sh + +system sh/deploy.sh -n dnode1 -i 1 +system sh/deploy.sh -n dnode2 -i 2 +system sh/deploy.sh -n dnode3 -i 3 +system sh/deploy.sh -n dnode4 -i 4 +system sh/cfg.sh -n dnode1 -c wallevel -v 2 +system sh/cfg.sh -n dnode2 -c wallevel -v 2 +system sh/cfg.sh -n dnode3 -c wallevel -v 2 +system sh/cfg.sh -n dnode4 -c wallevel -v 2 +system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1 +system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1 +system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1 +system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1 +system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4 +system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4 +system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4 +system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 4 +system sh/cfg.sh -n dnode1 -c debugFlag -v 131 +system sh/cfg.sh -n dnode2 -c debugFlag -v 131 +system sh/cfg.sh -n dnode3 -c debugFlag -v 131 +system sh/cfg.sh -n dnode4 -c debugFlag -v 131 +system sh/cfg.sh -n dnode1 -c arbitrator -v $arbitrator +system sh/cfg.sh -n dnode2 -c arbitrator -v $arbitrator +system sh/cfg.sh -n dnode3 -c arbitrator -v $arbitrator +system sh/cfg.sh -n dnode4 -c arbitrator -v $arbitrator + +print ============== step0: start tarbitrator +system sh/exec_tarbitrator.sh -s start + +system sh/exec.sh -n dnode1 -s start +sleep 3000 +sql connect + +sql create dnode $hostname2 +sql create dnode $hostname3 +system sh/exec.sh -n dnode2 -s start -t +system sh/exec.sh -n dnode3 -s start -t +sleep 3000 + +print ========= step1 +sql create database db replica 2 +#sql create table db.tb1 (ts timestamp, i int) +#sql create table db.tb2 (ts timestamp, i int) +#sql create table db.tb3 (ts timestamp, i int) +#sql create table db.tb4 (ts timestamp, i int) +#sql insert into db.tb1 values(now, 1) +#sql select count(*) from db.tb1 + +sql create database db replica 2 +sql create table db.tb (ts timestamp, i int) +sql insert into db.tb values(now, 1) +sql select count(*) from db.tb +$lastRows = $rows + +print ======== step2 +#run_back unique/vnode/back_insert_many.sim +run_back unique/vnode/back_insert.sim +sleep 3000 + +print ======== step3 + +$x = 0 +loop: + +print ======== step4 +system sh/exec.sh -n dnode2 -s stop -x SIGINT +sleep 10000 +system sh/exec.sh -n dnode2 -s start -t +sleep 10000 + +print ======== step5 +system sh/exec.sh -n dnode3 -s stop -x SIGINT +sleep 10000 +system sh/exec.sh -n dnode3 -s start -t +sleep 10000 + +print ======== step6 +#sql select count(*) from db.tb1 +#print select count(*) from db.tb1 ==> $data00 $lastRows +sql select count(*) from db.tb +print select count(*) from db.tb ==> $data00 $lastRows +if $data00 <= $lastRows then + return -1 +endi + +print ======== step7 +$lastRows = $data00 +print ======== loop Times $x + +if $x < 10 then + $x = $x + 1 + goto loop +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