mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Remove superior check for empty pools
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
parent
dbdf080108
commit
eb334d717a
@ -28,7 +28,6 @@ namespace ErrorCodes
|
||||
extern const int TOO_MANY_PARTITIONS;
|
||||
extern const int DISTRIBUTED_TOO_MANY_PENDING_BYTES;
|
||||
extern const int ARGUMENT_OUT_OF_BOUND;
|
||||
extern const int LOGICAL_ERROR;
|
||||
}
|
||||
|
||||
/// Can the batch be split and send files from batch one-by-one instead?
|
||||
@ -234,8 +233,6 @@ void DistributedAsyncInsertBatch::sendBatch(const SettingsChanges & settings_cha
|
||||
|
||||
auto timeouts = ConnectionTimeouts::getTCPTimeoutsWithFailover(insert_settings);
|
||||
auto result = parent.pool->getManyChecked(timeouts, insert_settings, PoolMode::GET_ONE, parent.storage.remote_storage.getQualifiedName());
|
||||
if (result.empty() || result.front().entry.isNull())
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Expected exactly one connection");
|
||||
if (distributed_header.insert_settings.distributed_insert_prefer_non_readonly_replica)
|
||||
sortConnectionPoolByNonReadOnlyReplicas(result);
|
||||
|
||||
@ -297,8 +294,6 @@ void DistributedAsyncInsertBatch::sendSeparateFiles(const SettingsChanges & sett
|
||||
|
||||
auto timeouts = ConnectionTimeouts::getTCPTimeoutsWithFailover(insert_settings);
|
||||
auto result = parent.pool->getManyChecked(timeouts, insert_settings, PoolMode::GET_ONE, parent.storage.remote_storage.getQualifiedName());
|
||||
if (result.empty() || result.front().entry.isNull())
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Expected exactly one connection");
|
||||
if (distributed_header.insert_settings.distributed_insert_prefer_non_readonly_replica)
|
||||
sortConnectionPoolByNonReadOnlyReplicas(result);
|
||||
|
||||
|
@ -413,9 +413,6 @@ void DistributedAsyncInsertDirectoryQueue::processFile(std::string & file_path,
|
||||
|
||||
auto timeouts = ConnectionTimeouts::getTCPTimeoutsWithFailover(insert_settings);
|
||||
auto result = pool->getManyChecked(timeouts, insert_settings, PoolMode::GET_ONE, storage.remote_storage.getQualifiedName());
|
||||
if (result.empty() || result.front().entry.isNull())
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Expected exactly one connection");
|
||||
|
||||
if (distributed_header.insert_settings.distributed_insert_prefer_non_readonly_replica)
|
||||
sortConnectionPoolByNonReadOnlyReplicas(result);
|
||||
|
||||
|
@ -375,10 +375,6 @@ DistributedSink::runWritingJob(JobReplica & job, const Block & current_block, si
|
||||
auto results = shard_info.pool->getManyChecked(timeouts, settings, PoolMode::GET_ONE, storage.remote_storage.getQualifiedName());
|
||||
if (settings.distributed_insert_prefer_non_readonly_replica)
|
||||
sortConnectionPoolByNonReadOnlyReplicas(results);
|
||||
|
||||
if (results.empty() || results.front().entry.isNull())
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Expected exactly one connection for shard {}", toString(job.shard_index));
|
||||
|
||||
job.connection_entry = std::move(results.front().entry);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user