mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 13:32:13 +00:00
Reset replica state in MultiplexedConnections in case of exception.
This commit is contained in:
parent
0c23d44b99
commit
0420b7bb33
@ -278,7 +278,18 @@ Packet MultiplexedConnections::receivePacketUnlocked(AsyncCallback async_callbac
|
|||||||
Packet packet;
|
Packet packet;
|
||||||
{
|
{
|
||||||
AsyncCallbackSetter async_setter(current_connection, std::move(async_callback));
|
AsyncCallbackSetter async_setter(current_connection, std::move(async_callback));
|
||||||
packet = current_connection->receivePacket();
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
packet = current_connection->receivePacket();
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
/// Exception may happen when packet is received, e.g. when got unknown packet.
|
||||||
|
/// In this case, invalidate replica, so that we would not read from it anymore.
|
||||||
|
current_connection->disconnect();
|
||||||
|
invalidateReplica(state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (packet.type)
|
switch (packet.type)
|
||||||
|
@ -6,4 +6,4 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
for _ in {1..10}; do $CLICKHOUSE_CLIENT -q "select number from remote('127.0.0.{2,3}', numbers(20)) limit 8 settings max_block_size = 2, unknown_packet_in_send_data=4, sleep_in_send_data_ms=100, async_socket_for_remote=1 format Null" 2>&1 > /dev/null; done
|
for _ in {1..10}; do $CLICKHOUSE_CLIENT -q "select number from remote('127.0.0.{2,3}', numbers(20)) limit 8 settings max_block_size = 2, unknown_packet_in_send_data=4, sleep_in_send_data_ms=100, async_socket_for_remote=1 format Null" > /dev/null 2>&1 || true; done
|
||||||
|
Loading…
Reference in New Issue
Block a user