mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
added 3 functional tests for parallel quorum inserts
This commit is contained in:
parent
8f8872dc42
commit
1de7dbafd9
@ -0,0 +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
|
38
tests/queries/0_stateless/01509_check_many_parallel_quorum_inserts.sh
Executable file
38
tests/queries/0_stateless/01509_check_many_parallel_quorum_inserts.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
NUM_REPLICAS=10
|
||||
|
||||
for i in $(seq 1 $NUM_REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT -n -q "
|
||||
DROP TABLE IF EXISTS r$i;
|
||||
CREATE TABLE r$i (x UInt64) ENGINE = ReplicatedMergeTree('/clickhouse/tables/test_01509/parallel_quorum_many', 'r$i') ORDER BY x;
|
||||
"
|
||||
done
|
||||
|
||||
$CLICKHOUSE_CLIENT -n -q "SYSTEM STOP REPLICATION QUEUES quorum2;"
|
||||
|
||||
function thread {
|
||||
for j in {0..9}; do
|
||||
a=$((($1 - 1) * 10 + $j))
|
||||
$CLICKHOUSE_CLIENT --insert_quorum 5 --insert_quorum_parallel 1 --query "INSERT INTO r$1 SELECT $a"
|
||||
done
|
||||
}
|
||||
|
||||
for i in $(seq 1 $NUM_REPLICAS); do
|
||||
thread $i &
|
||||
done
|
||||
|
||||
wait
|
||||
|
||||
for i in $(seq 1 $NUM_REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT -n -q "
|
||||
SYSTEM SYNC REPLICA r$i;
|
||||
SELECT count(), min(x), max(x), sum(x) FROM r$i;
|
||||
DROP TABLE IF EXISTS r$i;
|
||||
"
|
||||
done
|
@ -0,0 +1,2 @@
|
||||
5 1 5 15
|
||||
5 1 5 15
|
37
tests/queries/0_stateless/01509_check_parallel_quorum_inserts.sh
Executable file
37
tests/queries/0_stateless/01509_check_parallel_quorum_inserts.sh
Executable file
@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
NUM_REPLICAS=2
|
||||
NUM_INSERTS=5
|
||||
|
||||
for i in $(seq 1 $NUM_REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT -n -q "
|
||||
DROP TABLE IF EXISTS r$i;
|
||||
CREATE TABLE r$i (x UInt64) ENGINE = ReplicatedMergeTree('/clickhouse/tables/test_01509/parallel_quorum', 'r$i') ORDER BY x;
|
||||
"
|
||||
done
|
||||
|
||||
$CLICKHOUSE_CLIENT -n -q "SYSTEM STOP REPLICATION QUEUES quorum2;"
|
||||
|
||||
function thread {
|
||||
$CLICKHOUSE_CLIENT --insert_quorum 2 --insert_quorum_parallel 1 --query "INSERT INTO r1 SELECT $1"
|
||||
}
|
||||
|
||||
for i in $(seq 1 $NUM_INSERTS); do
|
||||
thread $i &
|
||||
done
|
||||
|
||||
$CLICKHOUSE_CLIENT -n -q "SYSTEM START REPLICATION QUEUES quorum2;"
|
||||
|
||||
wait
|
||||
|
||||
for i in $(seq 1 $NUM_REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT -n -q "
|
||||
SELECT count(), min(x), max(x), sum(x) FROM r$i;
|
||||
DROP TABLE IF EXISTS r$i;
|
||||
"
|
||||
done
|
@ -0,0 +1,2 @@
|
||||
5 1 5 15
|
||||
5 1 5 15
|
42
tests/queries/0_stateless/01509_check_parallel_quorum_inserts_with_merge.sh
Executable file
42
tests/queries/0_stateless/01509_check_parallel_quorum_inserts_with_merge.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
. "$CURDIR"/../shell_config.sh
|
||||
|
||||
NUM_REPLICAS=2
|
||||
|
||||
for i in $(seq 1 $NUM_REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT -n -q "
|
||||
DROP TABLE IF EXISTS r$i;
|
||||
CREATE TABLE r$i (x UInt64) ENGINE = ReplicatedMergeTree('/clickhouse/tables/test_01509/parallel_quorum_merge', 'r$i') ORDER BY x;
|
||||
"
|
||||
done
|
||||
|
||||
$CLICKHOUSE_CLIENT -n -q "
|
||||
SYSTEM STOP REPLICATION QUEUES quorum2;
|
||||
"
|
||||
|
||||
function thread {
|
||||
$CLICKHOUSE_CLIENT --insert_quorum 2 --insert_quorum_parallel 1 --query "INSERT INTO r1 SELECT $1"
|
||||
}
|
||||
|
||||
for i in {1..5}; do
|
||||
thread $i &
|
||||
done
|
||||
|
||||
|
||||
$CLICKHOUSE_CLIENT -n -q "
|
||||
OPTIMIZE TABLE r1 FINAL;
|
||||
SYSTEM START REPLICATION QUEUES quorum2;
|
||||
"
|
||||
|
||||
wait
|
||||
|
||||
for i in $(seq 1 $NUM_REPLICAS); do
|
||||
$CLICKHOUSE_CLIENT -n -q "
|
||||
SELECT count(), min(x), max(x), sum(x) FROM r$i;
|
||||
DROP TABLE IF EXISTS r$i;
|
||||
"
|
||||
done
|
Loading…
Reference in New Issue
Block a user