Skip to content

Commit f538461

Browse files
committed
tests: extended coverage for hedged requests and async socket
1 parent fbf035d commit f538461

File tree

4 files changed

+64
-29
lines changed

4 files changed

+64
-29
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- use_hedged_requests = 0, async_socket_for_remote = 0
2+
remote() 1 shard: 100
3+
remote() 3 shards: 300
4+
Distributed: 100
5+
-- use_hedged_requests = 0, async_socket_for_remote = 1
6+
remote() 1 shard: 100
7+
remote() 3 shards: 300
8+
Distributed: 100
9+
-- use_hedged_requests = 1, async_socket_for_remote = 0
10+
remote() 1 shard: 100
11+
remote() 3 shards: 300
12+
Distributed: 100
13+
-- use_hedged_requests = 1, async_socket_for_remote = 1
14+
remote() 1 shard: 100
15+
remote() 3 shards: 300
16+
Distributed: 100
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
3+
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
4+
# shellcheck source=../shell_config.sh
5+
. "$CUR_DIR"/../shell_config.sh
6+
7+
$CLICKHOUSE_CLIENT -m -q "
8+
drop table if exists 03444_local;
9+
drop table if exists 03444_distr;
10+
11+
create table 03444_local (id UInt32) engine = MergeTree order by id as select * from numbers(100);
12+
create table 03444_distr (id UInt32) engine = Distributed(test_cluster_one_shard_two_replicas, currentDatabase(), 03444_local);
13+
"
14+
15+
for use_hedged_requests in {0..1}; do
16+
for async_socket_for_remote in {0..1}; do
17+
echo "-- use_hedged_requests = $use_hedged_requests, async_socket_for_remote = $async_socket_for_remote"
18+
19+
$CLICKHOUSE_CLIENT -m -q "
20+
select 'remote() 1 shard: ' || count()
21+
from remote('127.0.0.1|127.0.0.2|127.0.0.3', currentDatabase(), 03444_local)
22+
settings prefer_localhost_replica = 0,
23+
max_parallel_replicas = 100,
24+
use_hedged_requests = $use_hedged_requests,
25+
async_socket_for_remote = $async_socket_for_remote;
26+
27+
select 'remote() 3 shards: ' || count()
28+
from remote('127.0.0.1|127.0.0.2,127.0.0.3|127.0.0.4,127.0.0.5|127.0.0.6', currentDatabase(), 03444_local)
29+
settings prefer_localhost_replica = 0,
30+
max_parallel_replicas = 100,
31+
use_hedged_requests = $use_hedged_requests,
32+
async_socket_for_remote = $async_socket_for_remote;
33+
34+
select 'Distributed: ' || count()
35+
from 03444_distr
36+
settings prefer_localhost_replica = 0,
37+
max_parallel_replicas = 100,
38+
use_hedged_requests = $use_hedged_requests,
39+
async_socket_for_remote = $async_socket_for_remote;
40+
"
41+
42+
done
43+
done
44+
45+
$CLICKHOUSE_CLIENT -m -q "
46+
drop table 03444_local;
47+
drop table 03444_distr;
48+
"

tests/queries/0_stateless/03444_distributed_wo_hedged_requests.reference

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/queries/0_stateless/03444_distributed_wo_hedged_requests.sql

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)