Fix query hang with connections_with_failover_max_tries = 0 (endless loop)

This commit is contained in:
Azat Khuzhin 2020-10-12 22:01:15 +03:00
parent a21b42f1f8
commit 2947eff878
3 changed files with 5 additions and 1 deletions

View File

@ -229,7 +229,7 @@ PoolWithFailoverBase<TNestedPool>::getMany(
ShuffledPool & shuffled_pool = shuffled_pools[i];
TryResult & result = try_results[i];
if (shuffled_pool.error_count >= max_tries || !result.entry.isNull())
if (max_tries && (shuffled_pool.error_count >= max_tries || !result.entry.isNull()))
continue;
std::string fail_message;

View File

@ -0,0 +1,3 @@
-- regression for endless loop with connections_with_failover_max_tries=0
set connections_with_failover_max_tries=0;
select * from remote('127.2', system.one);