mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 01:00:48 +00:00
fix race on system restart replica
This commit is contained in:
parent
24615059fb
commit
77178a18fa
@ -573,7 +573,9 @@ StoragePtr InterpreterSystemQuery::tryRestartReplica(const StorageID & replica,
|
||||
|
||||
database->detachTable(system_context, replica.table_name);
|
||||
}
|
||||
UUID uuid = table->getStorageID().uuid;
|
||||
table.reset();
|
||||
database->waitDetachedTableNotInUse(uuid);
|
||||
|
||||
/// Attach actions
|
||||
/// getCreateTableQuery must return canonical CREATE query representation, there are no need for AST postprocessing
|
||||
|
@ -428,8 +428,6 @@ void TCPHandler::runImpl()
|
||||
if (e.code() == ErrorCodes::UNKNOWN_PACKET_FROM_CLIENT)
|
||||
throw;
|
||||
|
||||
LOG_TEST(log, "Going to close connection due to exception: {}", e.message());
|
||||
|
||||
/// If there is UNEXPECTED_PACKET_FROM_CLIENT emulate network_error
|
||||
/// to break the loop, but do not throw to send the exception to
|
||||
/// the client.
|
||||
@ -439,6 +437,9 @@ void TCPHandler::runImpl()
|
||||
/// If a timeout occurred, try to inform client about it and close the session
|
||||
if (e.code() == ErrorCodes::SOCKET_TIMEOUT)
|
||||
network_error = true;
|
||||
|
||||
if (network_error)
|
||||
LOG_TEST(log, "Going to close connection due to exception: {}", e.message());
|
||||
}
|
||||
catch (const Poco::Net::NetException & e)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user