mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-28 11:21:09 +00:00
ReplicatedMergeTree: Better diagnostics [#CLICKHOUSE-2]
This commit is contained in:
parent
2a749ccffa
commit
40a8859803
@ -190,7 +190,7 @@ void ReplicatedMergeTreeAlterThread::run()
|
|||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
tryLogCurrentException(log, __PRETTY_FUNCTION__);
|
||||||
|
|
||||||
force_recheck_parts = true;
|
force_recheck_parts = true;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ void ReplicatedMergeTreeCleanupThread::run()
|
|||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
tryLogCurrentException(log, __PRETTY_FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
storage.cleanup_thread_event.tryWait(CLEANUP_SLEEP_MS);
|
storage.cleanup_thread_event.tryWait(CLEANUP_SLEEP_MS);
|
||||||
|
@ -265,7 +265,7 @@ void ReplicatedMergeTreePartCheckThread::checkPart(const String & part_name)
|
|||||||
{
|
{
|
||||||
/// TODO Better to check error code.
|
/// TODO Better to check error code.
|
||||||
|
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
tryLogCurrentException(log, __PRETTY_FUNCTION__);
|
||||||
|
|
||||||
LOG_ERROR(log, "Part " << part_name << " looks broken. Removing it and queueing a fetch.");
|
LOG_ERROR(log, "Part " << part_name << " looks broken. Removing it and queueing a fetch.");
|
||||||
ProfileEvents::increment(ProfileEvents::ReplicatedPartChecksFailed);
|
ProfileEvents::increment(ProfileEvents::ReplicatedPartChecksFailed);
|
||||||
@ -383,7 +383,7 @@ void ReplicatedMergeTreePartCheckThread::run()
|
|||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
tryLogCurrentException(log, __PRETTY_FUNCTION__);
|
||||||
wakeup_event.tryWait(PART_CHECK_ERROR_SLEEP_MS);
|
wakeup_event.tryWait(PART_CHECK_ERROR_SLEEP_MS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ void ReplicatedMergeTreeRestartingThread::run()
|
|||||||
catch (const zkutil::KeeperException & e)
|
catch (const zkutil::KeeperException & e)
|
||||||
{
|
{
|
||||||
/// The exception when you try to zookeeper_init usually happens if DNS does not work. We will try to do it again.
|
/// The exception when you try to zookeeper_init usually happens if DNS does not work. We will try to do it again.
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
tryLogCurrentException(log, __PRETTY_FUNCTION__);
|
||||||
|
|
||||||
if (first_time)
|
if (first_time)
|
||||||
storage.startup_event.set();
|
storage.startup_event.set();
|
||||||
@ -157,7 +157,7 @@ void ReplicatedMergeTreeRestartingThread::run()
|
|||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
storage.startup_event.set();
|
storage.startup_event.set();
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
tryLogCurrentException(log, __PRETTY_FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
wakeup_event.tryWait(check_period_ms);
|
wakeup_event.tryWait(check_period_ms);
|
||||||
@ -180,7 +180,7 @@ void ReplicatedMergeTreeRestartingThread::run()
|
|||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
tryLogCurrentException(log, __PRETTY_FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DEBUG(log, "Restarting thread finished");
|
LOG_DEBUG(log, "Restarting thread finished");
|
||||||
|
@ -240,7 +240,7 @@ StorageReplicatedMergeTree::StorageReplicatedMergeTree(
|
|||||||
/// Failed to connect to ZK (this became known when trying to perform the first operation).
|
/// Failed to connect to ZK (this became known when trying to perform the first operation).
|
||||||
if (e.code == ZooKeeperImpl::ZooKeeper::ZCONNECTIONLOSS)
|
if (e.code == ZooKeeperImpl::ZooKeeper::ZCONNECTIONLOSS)
|
||||||
{
|
{
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
tryLogCurrentException(log, __PRETTY_FUNCTION__);
|
||||||
current_zookeeper = nullptr;
|
current_zookeeper = nullptr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1474,7 +1474,7 @@ bool StorageReplicatedMergeTree::executeFetch(const StorageReplicatedMergeTree::
|
|||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
tryLogCurrentException(log, __PRETTY_FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw;
|
throw;
|
||||||
@ -1612,7 +1612,7 @@ void StorageReplicatedMergeTree::queueUpdatingThread()
|
|||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
tryLogCurrentException(log, __PRETTY_FUNCTION__);
|
||||||
queue_updating_event->tryWait(QUEUE_UPDATE_ERROR_SLEEP_MS);
|
queue_updating_event->tryWait(QUEUE_UPDATE_ERROR_SLEEP_MS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1632,7 +1632,7 @@ bool StorageReplicatedMergeTree::queueTask()
|
|||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
tryLogCurrentException(log, __PRETTY_FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
LogEntryPtr & entry = selected.first;
|
LogEntryPtr & entry = selected.first;
|
||||||
@ -1666,7 +1666,7 @@ bool StorageReplicatedMergeTree::queueTask()
|
|||||||
LOG_INFO(log, e.displayText());
|
LOG_INFO(log, e.displayText());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
tryLogCurrentException(log, __PRETTY_FUNCTION__);
|
||||||
|
|
||||||
/** This exception will be written to the queue element, and it can be looked up using `system.replication_queue` table.
|
/** This exception will be written to the queue element, and it can be looked up using `system.replication_queue` table.
|
||||||
* The thread that performs this action will sleep a few seconds after the exception.
|
* The thread that performs this action will sleep a few seconds after the exception.
|
||||||
@ -1676,7 +1676,7 @@ bool StorageReplicatedMergeTree::queueTask()
|
|||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
tryLogCurrentException(log, __PRETTY_FUNCTION__);
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1935,7 +1935,7 @@ void StorageReplicatedMergeTree::mergeSelectingThread()
|
|||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
tryLogCurrentException(log, __PRETTY_FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_leader)
|
if (!is_leader)
|
||||||
|
Loading…
Reference in New Issue
Block a user