Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

fuziontech
Copy link
Member

@fuziontech fuziontech commented Jan 9, 2025

  • docker working for frontend dev
  • feat: add a view for failed replication items
image image

Copy link

sentry-io bot commented Jan 9, 2025

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: housewatch/clickhouse/client.py

Function Unhandled Issue
run_query KeyError: 'host_address' /api/replication/
Event Count: 100
run_query AttributeError: '_GeneratorContextManager' object has no attribute 'execute' housewatch.cl...
Event Count: 18

Did you find this useful? React with a 👍 or 👎

Copy link
Contributor

@Daesgar Daesgar left a 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>[] = [
Copy link
Contributor

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. 🕵️

Comment on lines +62 to +95
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)
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants