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 commitLog -v 0 system sh/cfg.sh -n dnode2 -c commitLog -v 0 system sh/cfg.sh -n dnode3 -c commitLog -v 0 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.sh -n dnode1 -s start sql connect sql create dnode 192.168.0.2 sql create dnode 192.168.0.3 system sh/exec.sh -n dnode2 -s start system sh/exec.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.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.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.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.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.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.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.sh -n dnode1 -s stop system sh/exec.sh -n dnode2 -s stop system sh/exec.sh -n dnode3 -s stop