mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Use 10 replicas in test
This commit is contained in:
parent
5763737d97
commit
538b7730dd
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user