mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
Fix excessive connect attempts with skip_unavailable_shards
Before this patch the query was sent from RemoteBlockInputStream::readPrefix() and also from RemoteBlockInputStream::read(). And since in case of skip_unavailable_shards=1 connection errors are ignored, it tries to do x2 connect attempts. Fix this, but removing RemoteBlockInputStream::readPrefix(). Fixes: #26511
This commit is contained in:
parent
09449cc101
commit
7b7e8acf4f
@ -38,11 +38,6 @@ void RemoteBlockInputStream::init()
|
|||||||
query_executor.setLogger(log);
|
query_executor.setLogger(log);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoteBlockInputStream::readPrefix()
|
|
||||||
{
|
|
||||||
query_executor.sendQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
void RemoteBlockInputStream::cancel(bool kill)
|
void RemoteBlockInputStream::cancel(bool kill)
|
||||||
{
|
{
|
||||||
if (kill)
|
if (kill)
|
||||||
|
@ -52,9 +52,6 @@ public:
|
|||||||
|
|
||||||
void setMainTable(StorageID main_table_) { query_executor.setMainTable(std::move(main_table_)); }
|
void setMainTable(StorageID main_table_) { query_executor.setMainTable(std::move(main_table_)); }
|
||||||
|
|
||||||
/// Sends query (initiates calculation) before read()
|
|
||||||
void readPrefix() override;
|
|
||||||
|
|
||||||
/// Prevent default progress notification because progress' callback is called by its own.
|
/// Prevent default progress notification because progress' callback is called by its own.
|
||||||
void progress(const Progress & /*value*/) override {}
|
void progress(const Progress & /*value*/) override {}
|
||||||
|
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
Connection failed at try №1,
|
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL=trace
|
||||||
|
|
||||||
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
# shellcheck source=../shell_config.sh
|
||||||
|
. "$CURDIR"/../shell_config.sh
|
||||||
|
|
||||||
|
opts=(
|
||||||
|
"--connections_with_failover_max_tries=1"
|
||||||
|
"--skip_unavailable_shards=1"
|
||||||
|
)
|
||||||
|
$CLICKHOUSE_CLIENT --query "select * from remote('255.255.255.255', system.one)" "${opts[@]}" 2>&1 | grep -o 'Connection failed at try.*,'
|
Loading…
Reference in New Issue
Block a user