Use 10 replicas in test

This commit is contained in:
Alexey Milovidov 2020-08-28 04:02:04 +03:00
parent 5763737d97
commit 538b7730dd
2 changed files with 24 additions and 19 deletions

View File

@ -1,2 +1,10 @@
100 0 99 4950 100 0 99 4950
100 0 99 4950 100 0 99 4950
100 0 99 4950
100 0 99 4950
100 0 99 4950
100 0 99 4950
100 0 99 4950
100 0 99 4950
100 0 99 4950
100 0 99 4950

View File

@ -5,13 +5,14 @@ set -e
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. "$CURDIR"/../shell_config.sh . "$CURDIR"/../shell_config.sh
$CLICKHOUSE_CLIENT -n -q " NUM_REPLICAS=10
DROP TABLE IF EXISTS r1;
DROP TABLE IF EXISTS r2;
CREATE TABLE r1 (x UInt64) ENGINE = ReplicatedMergeTree('/clickhouse/tables/r', 'r1') ORDER BY x; for i in $(seq 1 $NUM_REPLICAS); do
CREATE TABLE r2 (x UInt64) ENGINE = ReplicatedMergeTree('/clickhouse/tables/r', 'r2') ORDER BY x; $CLICKHOUSE_CLIENT -n -q "
" DROP TABLE IF EXISTS r$i;
CREATE TABLE r$i (x UInt64) ENGINE = ReplicatedMergeTree('/clickhouse/tables/r', 'r$i') ORDER BY x;
"
done
function thread { function thread {
for x in {0..99}; do for x in {0..99}; do
@ -19,20 +20,16 @@ function thread {
done done
} }
thread 1 & for i in $(seq 1 $NUM_REPLICAS); do
thread 2 & thread $i &
done
wait wait
$CLICKHOUSE_CLIENT -n -q " for i in $(seq 1 $NUM_REPLICAS); do
SYSTEM SYNC REPLICA r1; $CLICKHOUSE_CLIENT -n -q "
SYSTEM SYNC REPLICA r2; SYSTEM SYNC REPLICA r$i;
" SELECT count(), min(x), max(x), sum(x) FROM r$i;
DROP TABLE IF EXISTS r$i;
$CLICKHOUSE_CLIENT -q "SELECT count(), min(x), max(x), sum(x) FROM r1";
$CLICKHOUSE_CLIENT -q "SELECT count(), min(x), max(x), sum(x) FROM r2";
$CLICKHOUSE_CLIENT -n -q "
DROP TABLE IF EXISTS r1;
DROP TABLE IF EXISTS r2;
" "
done