-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: debug page for failed replication items in the queue #79
base: main
Are you sure you want to change the base?
Conversation
fuziontech
commented
Jan 9, 2025
•
edited
Loading
edited
- docker working for frontend dev
- feat: add a view for failed replication items


🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: housewatch/clickhouse/client.py
Did you find this useful? React with a 👍 or 👎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Added just 2 small suggestions but nothing blocking.
fetchClusters() | ||
}, []) | ||
|
||
const columns: ColumnType<ReplicationQueueItem>[] = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also retrieve the last_exception_time
? It's useful to compare the time the exception happened with the last_attempt
time. Also, having the source_replica
gives a hint of which host could be the source of the issue. 🕵️
def get_replication_queues(cluster): | ||
nodes = get_all_replica_hosts(cluster) | ||
for node in nodes: | ||
yield get_replication_queue(node) | ||
|
||
|
||
def get_replication_queue(node): | ||
QUERY = """ | ||
SELECT | ||
database, | ||
table, | ||
replica_name, | ||
position, | ||
node_name, | ||
type, | ||
create_time, | ||
required_quorum, | ||
source_replica, | ||
new_part_name, | ||
parts_to_merge, | ||
is_detach, | ||
is_currently_executing, | ||
num_tries, | ||
last_exception, | ||
last_attempt_time, | ||
last_postpone_time, | ||
postpone_reason, | ||
merge_type | ||
FROM system.replication_queue | ||
WHERE last_exception != '' or postpone_reason != '' | ||
ORDER BY create_time desc | ||
LIMIT 100 | ||
""" | ||
return run_query(QUERY, node=node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this instead of a clusterAllReplicas
? If it's because some replica could be unavailable, we could use this setting in the query