-
-
Save tom-clickhouse/9fa07e8a54acde9dfaa0a296f001ab93 to your computer and use it in GitHub Desktop.
Observe async insert errors during buffer flushes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH | |
'default' AS db_name, | |
'upclick_metrics' AS table_name, | |
10 as last_x_minutes | |
SELECT | |
DENSE_RANK() OVER(ORDER BY hostName()) AS n, | |
max(event_time) AS flush, | |
status, | |
exception, | |
any(query_id) AS query_id | |
FROM | |
clusterAllReplicas(default, system.asynchronous_insert_log) | |
WHERE | |
status <> 'Ok' | |
AND database = db_name AND table = table_name | |
AND event_time > now() - toIntervalMinute(last_x_minutes) | |
GROUP BY hostName(), status, exception | |
ORDER BY | |
hostName(), flush DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment