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

[HealthAPI] Add support for the FEATURE_STATE affected resource #92296

Merged
merged 8 commits into from
Dec 20, 2022

Conversation

andreidan
Copy link
Contributor

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

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]>
@github-actions
Copy link
Contributor

Documentation preview:

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Dec 12, 2022
@elasticsearchmachine
Copy link
Collaborator

Hi @andreidan, I've created a changelog YAML for you.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

Comment on lines +214 to +217
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.:
+
Copy link
Contributor Author

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 )

@andreidan
Copy link
Contributor Author

@elasticmachine update branch

Copy link
Member

@dakrone dakrone left a 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

* 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(
Copy link
Member

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)

@andreidan
Copy link
Contributor Author

@elasticmachine update branch

@andreidan andreidan merged commit 9170113 into elastic:main Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[HealthAPI] report affected feature states
4 participants