-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
[HealthAPI] Add support for the FEATURE_STATE affected resource #92296
Conversation
The `shards_availability` indicator diagnoses the condition where indices need to be restored from snapshot. Starting with 8.0 using feature_states when restoring from snapshot is mandatory. This adds support for the `FEATURE_STATE` affected resource to aid with building up the snapshot restore API call (which will need to include all the indices and feature states reported by the restore-from-snapshot diagnosis). Note that the health API will not report any indices that are part of a feature state.
(cherry picked from commit 81d41eb17be41b6d128e25fa76db720b241cb72c) Signed-off-by: Andrei Dan <[email protected]>
Documentation preview: |
Hi @andreidan, I've created a changelog YAML for you. |
Pinging @elastic/es-data-management (Team:Data Management) |
NOTE: If any <<feature-state,feature states>> need to be restored we'll need to specify them using the | ||
`feature_states` field and the indices that belong to the feature states we restore must not be specified under `indices`. | ||
The <<health-api, Health API>> returns both the `indices` and `feature_states` that need to be restored for the restore from snapshot diagnosis. e.g.: | ||
+ |
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.
It's rather unfortunate we can't recommend something better here because there currently is no way of getting the system indices/data streams associated with a feature state ( #86307 )
@elasticmachine update branch |
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.
LGTM, I left two pretty minor comments
...a/org/elasticsearch/cluster/routing/allocation/ShardsAvailabilityHealthIndicatorService.java
Outdated
Show resolved
Hide resolved
* identified unassigned indices and returns the affected {@link Diagnosis.Resource}s of type `INDEX` | ||
* and if applicable `FEATURE_STATE` | ||
*/ | ||
private static List<Diagnosis.Resource> getRestoreFromSnapshotAffectedResources( |
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 think we could make this non-private and unit test this pretty easily right? Could you add some tests for that? (It's a complex enough method that I want to make sure we don't break it in the future)
@elasticmachine update branch |
The shards_availability indicator diagnoses the condition where indices need to be restored from snapshot.
Starting with 8.0 using feature_states when restoring from snapshot is mandatory.
This adds support for the FEATURE_STATE affected resource to aid with building up the snapshot restore API call (which will need to include all the indices and feature states reported by the restore-from-snapshot diagnosis).
Note that the health API will not report any indices that are part of a feature state.
Closes #91353