Repository navigation
Introduce grey collection status and expose shard status in telemetry - #4940
Merged
Merged
Conversation
KShivendu
marked this pull request as draft
August 22, 2024 17:49
KShivendu
marked this pull request as ready for review
August 23, 2024 08:36
KShivendu
commented
Aug 23, 2024
generall
reviewed
Aug 23, 2024
timvisee
reviewed
Aug 26, 2024
timvisee
reviewed
Sep 2, 2024
Comment on lines
+68
to
+72
| Shard::Local(local_shard) => { | ||
| let mut shard_telemetry = local_shard.get_telemetry_data(detail); | ||
| shard_telemetry.status = Some(local_shard.local_shard_info().await.status); | ||
| shard_telemetry | ||
| } |
Member
There was a problem hiding this comment.
We only do it this way because we want to expose the status to cluster manager, am I right?
Contributor
There was a problem hiding this comment.
Looks kinda ugly... 😬
I'd add a comment explaining why is it structured like this (e.g., why not just move local_shard_info inside get_telemetry_data).
ffuugoo
approved these changes
Sep 2, 2024
ffuugoo
left a comment
Contributor
There was a problem hiding this comment.
LGTM with a very minor comments. Good job, @KShivendu! 👍
Comment on lines
+68
to
+72
| Shard::Local(local_shard) => { | ||
| let mut shard_telemetry = local_shard.get_telemetry_data(detail); | ||
| shard_telemetry.status = Some(local_shard.local_shard_info().await.status); | ||
| shard_telemetry | ||
| } |
Contributor
There was a problem hiding this comment.
Looks kinda ugly... 😬
I'd add a comment explaining why is it structured like this (e.g., why not just move local_shard_info inside get_telemetry_data).
timvisee
requested changes
Sep 4, 2024
timvisee
approved these changes
Sep 4, 2024
timvisee
reviewed
Sep 4, 2024
7 tasks done
timvisee
pushed a commit
that referenced
this pull request
Sep 17, 2024
…#4940) * Expose shard status in telemetry API * fmt * Drop segment lock before using async fetching shard status * Use Self in From implementation for ShardStatus to CollectionStatus mapping * Improve comments * Remove redundant clone * Update openapi specs * Isolate function for shard status * Fix compiler error * Avoid adding dedicated function for shard status * review fixes * define missing var * lint err * comment * comment * refactor * improve comments * Improve comments * fix lint and update openapi specs * improve comment
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces a
statusfield in telemetry response for each of the local shard. It will have same possible values as the collection status (green, yellow, grey, red). So shard telemetry will look like:{ "shards": [ { "id": 0, "local": { "variant_name": "local shard", "status": "green", // --------------------> new addition "segments": [ "..." ], "optimizations": { "status": "ok", "optimizations": { "count": 0, "total_duration_micros": 0, "last_responded": "2024-08-23T08:57:39.410Z" }, "log": [] } }, "remote": [], "replicate_states": { "2762498644323566": "Active" } } ], "transfers": [] }This feature will be used to assess if a replica is indexed enough.
This PR does the following:
v1.10. It means that shard is available, but some segments have pending optimization.CollectionInfoInternaltoShardInfoInternalto better represent that the struct represents shard level data. The same struct is eventually used to buildCollectionInfowhich is exposed by the APIs.ShardStatusto be used in shard telemetry. This is also converted intoCollectionStatuswhen representating collection status (say for/collection/<collection>API)All Submissions:
devbranch. Did you create your branch fromdev?