system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/deploy.sh -n dnode2 -i 2 system sh/deploy.sh -n dnode3 -i 3 system sh/cfg.sh -n dnode1 -c clog -v 2 system sh/cfg.sh -n dnode2 -c clog -v 2 system sh/cfg.sh -n dnode3 -c clog -v 2 system sh/cfg.sh -n dnode1 -c numofMpeers -v 3 system sh/cfg.sh -n dnode2 -c numofMpeers -v 3 system sh/cfg.sh -n dnode3 -c numofMpeers -v 3 system sh/exec_up.sh -n dnode1 -s start sql connect sql create dnode $hostname2 sql create dnode $hostname3 system sh/exec_up.sh -n dnode2 -s start system sh/exec_up.sh -n dnode3 -s start sleep 3000 $N = 10 $table = table_r3 $db = db1 sleep 3000 print =================== step 1 sql create database $db replica 3 sql use $db sql create table $table (ts timestamp, speed int) sleep 3001 print =================== step 2 $x = 1 $y = $x + $N $expect = $N while $x < $y $ms = $x . m sql insert into $table values (now + $ms , $x ) $x = $x + 1 endw sql select * from $table print sql select * from $table -> $rows points if $rows != $expect then return -1 endi print =================== step 3 system sh/exec_up.sh -n dnode2 -s stop sleep 2000 $y = $x + $N $expect = $N * 2 while $x < $y $ms = $x . m sql insert into $table values (now + $ms , $x ) $x = $x + 1 endw sql select * from $table print sql select * from $table -> $rows points if $rows != $expect then return -1 endi print =================== step 4 system sh/exec_up.sh -n dnode2 -s start sleep 2000 $y = $x + $N $expect = $N * 3 while $x < $y $ms = $x . m sql insert into $table values (now + $ms , $x ) $x = $x + 1 endw sql select * from $table print sql select * from $table -> $rows points if $rows != $expect then return -1 endi print =================== step 5 system sh/exec_up.sh -n dnode3 -s stop sleep 2000 $y = $x + $N $expect = $N * 4 while $x < $y $ms = $x . m sql insert into $table values (now + $ms , 10) $x = $x + 1 endw sql select * from $table print sql select * from $table -> $rows points if $rows != $expect then return -1 endi print =================== step 6 system sh/exec_up.sh -n dnode3 -s start sleep 2000 $y = $x + $N $expect = $N * 5 while $x < $y $ms = $x . m sql insert into $table values (now + $ms , $x ) $x = $x + 1 endw sql select * from $table print sql select * from $table -> $rows points if $rows != $expect then return -1 endi print =================== step 7 system sh/exec_up.sh -n dnode1 -s stop sleep 2000 $y = $x + $N $expect = $N * 6 while $x < $y $ms = $x . m sql insert into $table values (now + $ms , 10) $x = $x + 1 endw sql select * from $table print sql select * from $table -> $rows points if $rows != $expect then return -1 endi print =================== step 8 system sh/exec_up.sh -n dnode1 -s start sleep 2000 $y = $x + $N $expect = $N * 7 while $x < $y $ms = $x . m sql insert into $table values (now + $ms , 10) $x = $x + 1 endw sql select * from $table print sql select * from $table -> $rows points if $rows != $expect then return -1 endi system sh/exec_up.sh -n dnode1 -s stop system sh/exec_up.sh -n dnode2 -s stop system sh/exec_up.sh -n dnode3 -s stop