|
| 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 | +" |
0 commit comments