-
Notifications
You must be signed in to change notification settings - Fork 581
Add sys.cluster_health
table to get the overall cluster health
#17617
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
Conversation
6fbb4a8
to
2bba4e3
Compare
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.
Thank you! Left some minor comments
Additionally, maybe add one more test when cluster is YELLOW and tables are RED, (the code path is tested already so maybe an overkill).
server/src/main/java/io/crate/metadata/sys/SysTableDefinitions.java
Outdated
Show resolved
Hide resolved
server/src/test/java/io/crate/metadata/sys/SysClusterHealthTest.java
Outdated
Show resolved
Hide resolved
server/src/test/java/io/crate/metadata/sys/SysClusterHealthTest.java
Outdated
Show resolved
Hide resolved
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.
thank you!
This pull request has been removed from the queue for the following reason: Pull request #17617 has been dequeued, merge conditions unmatch:
You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you can post a |
if (health == TableHealth.Health.RED || tableHealth.getMissingShards() > 0) { | ||
finalDescription = "One or more tables are missing shards"; | ||
} else if (health == TableHealth.Health.YELLOW) { | ||
finalDescription = "One or more tables have underreplicated shards"; |
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.
Do you think it would make sense to include the table names in the description, or would that get too long? (Maybe with truncation, after 10 tables or so)
Given that the info can be retrieved via sys.health
in a structured way it is probably not too important, but could be convenient.
(Not a blocker)
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.
I wonder how much this helps, as if this occurs, one might need to look into sys.health
to read the missing/underreplicated shards per each table anyway. But if you think it's helpful, I'm fine to add this (with truncation).
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.
We can also leave it as is for now, and extend it later if we notice that it would be useful to have the info.
df33ff6
to
a5b5d06
Compare
This new table will expose the overall cluster health based on the cluster state and individual table health exposed by the existing `sys.health` table. For example, if the cluster is starting and recovering, no table is yet available, such `sys.health` will return an empty result set. Such a state will result in a `RED` overal cluster health exposed by this new table. Relates to #17600.
a5b5d06
to
116240b
Compare
This new table will expose the overall cluster health based on the cluster state and individual table health exposed by the existing
sys.health
table.For example, if the cluster is starting and recovering, no table is yet available, such
sys.health
will return an empty result set. Such a state will result in aRED
overal cluster health exposed by this new table.Relates to #17600.