ReplicatedMergeTree: Better diagnostics [#CLICKHOUSE-2]

This commit is contained in:
Alexey Milovidov 2018-04-07 00:46:57 +03:00 committed by proller
parent 2a749ccffa
commit 40a8859803
5 changed files with 14 additions and 14 deletions

View File

@ -190,7 +190,7 @@ void ReplicatedMergeTreeAlterThread::run()
}
catch (...)
{
tryLogCurrentException(__PRETTY_FUNCTION__);
tryLogCurrentException(log, __PRETTY_FUNCTION__);
force_recheck_parts = true;

View File

@ -38,7 +38,7 @@ void ReplicatedMergeTreeCleanupThread::run()
}
catch (...)
{
tryLogCurrentException(__PRETTY_FUNCTION__);
tryLogCurrentException(log, __PRETTY_FUNCTION__);
}
storage.cleanup_thread_event.tryWait(CLEANUP_SLEEP_MS);

View File

@ -265,7 +265,7 @@ void ReplicatedMergeTreePartCheckThread::checkPart(const String & part_name)
{
/// 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.");
ProfileEvents::increment(ProfileEvents::ReplicatedPartChecksFailed);
@ -383,7 +383,7 @@ void ReplicatedMergeTreePartCheckThread::run()
}
catch (...)
{
tryLogCurrentException(__PRETTY_FUNCTION__);
tryLogCurrentException(log, __PRETTY_FUNCTION__);
wakeup_event.tryWait(PART_CHECK_ERROR_SLEEP_MS);
}
}

View File

@ -92,7 +92,7 @@ void ReplicatedMergeTreeRestartingThread::run()
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.
tryLogCurrentException(__PRETTY_FUNCTION__);
tryLogCurrentException(log, __PRETTY_FUNCTION__);
if (first_time)
storage.startup_event.set();
@ -157,7 +157,7 @@ void ReplicatedMergeTreeRestartingThread::run()
catch (...)
{
storage.startup_event.set();
tryLogCurrentException(__PRETTY_FUNCTION__);
tryLogCurrentException(log, __PRETTY_FUNCTION__);
}
wakeup_event.tryWait(check_period_ms);
@ -180,7 +180,7 @@ void ReplicatedMergeTreeRestartingThread::run()
}
catch (...)
{
tryLogCurrentException(__PRETTY_FUNCTION__);
tryLogCurrentException(log, __PRETTY_FUNCTION__);
}
LOG_DEBUG(log, "Restarting thread finished");

View File

@ -240,7 +240,7 @@ StorageReplicatedMergeTree::StorageReplicatedMergeTree(
/// Failed to connect to ZK (this became known when trying to perform the first operation).
if (e.code == ZooKeeperImpl::ZooKeeper::ZCONNECTIONLOSS)
{
tryLogCurrentException(__PRETTY_FUNCTION__);
tryLogCurrentException(log, __PRETTY_FUNCTION__);
current_zookeeper = nullptr;
}
else
@ -1474,7 +1474,7 @@ bool StorageReplicatedMergeTree::executeFetch(const StorageReplicatedMergeTree::
}
catch (...)
{
tryLogCurrentException(__PRETTY_FUNCTION__);
tryLogCurrentException(log, __PRETTY_FUNCTION__);
}
throw;
@ -1612,7 +1612,7 @@ void StorageReplicatedMergeTree::queueUpdatingThread()
}
catch (...)
{
tryLogCurrentException(__PRETTY_FUNCTION__);
tryLogCurrentException(log, __PRETTY_FUNCTION__);
queue_updating_event->tryWait(QUEUE_UPDATE_ERROR_SLEEP_MS);
}
}
@ -1632,7 +1632,7 @@ bool StorageReplicatedMergeTree::queueTask()
}
catch (...)
{
tryLogCurrentException(__PRETTY_FUNCTION__);
tryLogCurrentException(log, __PRETTY_FUNCTION__);
}
LogEntryPtr & entry = selected.first;
@ -1666,7 +1666,7 @@ bool StorageReplicatedMergeTree::queueTask()
LOG_INFO(log, e.displayText());
}
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.
* The thread that performs this action will sleep a few seconds after the exception.
@ -1676,7 +1676,7 @@ bool StorageReplicatedMergeTree::queueTask()
}
catch (...)
{
tryLogCurrentException(__PRETTY_FUNCTION__);
tryLogCurrentException(log, __PRETTY_FUNCTION__);
throw;
}
});
@ -1935,7 +1935,7 @@ void StorageReplicatedMergeTree::mergeSelectingThread()
}
catch (...)
{
tryLogCurrentException(__PRETTY_FUNCTION__);
tryLogCurrentException(log, __PRETTY_FUNCTION__);
}
if (!is_leader)