mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Force_connected for retry resume connection establisher
This commit is contained in:
parent
9f46c1116a
commit
838408ff0a
@ -151,7 +151,8 @@ void ConnectionEstablisherAsync::Task::run(AsyncCallback async_callback, Suspend
|
||||
{
|
||||
connection_establisher_async.reset();
|
||||
connection_establisher_async.connection_establisher.setAsyncCallback(async_callback);
|
||||
connection_establisher_async.connection_establisher.run(connection_establisher_async.result, connection_establisher_async.fail_message);
|
||||
connection_establisher_async.connection_establisher.run(connection_establisher_async.result,
|
||||
connection_establisher_async.fail_message, connection_establisher_async.force_connected);
|
||||
connection_establisher_async.is_finished = true;
|
||||
}
|
||||
|
||||
|
@ -76,6 +76,8 @@ public:
|
||||
|
||||
const std::string & getFailMessage() const { return fail_message; }
|
||||
|
||||
void resumeConnectionWithForceOption(bool force_connected_) {force_connected = force_connected_; resume();}
|
||||
|
||||
private:
|
||||
bool checkBeforeTaskResume() override;
|
||||
|
||||
@ -125,6 +127,7 @@ private:
|
||||
|
||||
bool is_finished = false;
|
||||
bool restarted = false;
|
||||
bool force_connected = false;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -281,7 +281,7 @@ int HedgedConnectionsFactory::getReadyFileDescriptor(bool blocking, AsyncCallbac
|
||||
|
||||
HedgedConnectionsFactory::State HedgedConnectionsFactory::resumeConnectionEstablisher(int index, Connection *& connection_out)
|
||||
{
|
||||
replicas[index].connection_establisher->resume();
|
||||
replicas[index].connection_establisher->resumeConnectionWithForceOption(/*force_connected_*/ shuffled_pools[index].error_count != 0);
|
||||
|
||||
if (replicas[index].connection_establisher->isCancelled())
|
||||
return State::CANNOT_CHOOSE;
|
||||
|
Loading…
Reference in New Issue
Block a user