-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Snapshot restore] Add support for feature_states #131310
[Snapshot restore] Add support for feature_states #131310
Conversation
...components/restore_snapshot_form/steps/step_logistics/system_indices_overwritten_callout.tsx
Show resolved
Hide resolved
...cy_form/steps/step_settings/fields/include_global_state_field/include_global_state_field.tsx
Outdated
Show resolved
Hide resolved
Pinging @elastic/platform-deployment-management (Team:Deployment Management) |
@elasticmachine merge upstream |
Thanks for having a look everyone! I’ve met with @cristina-eleonora to discuss more in details how we thought this feature should work and we ended up coming to the decision to keep both include global state and feature states as separate options in the UI. This not only makes it more explicit to the user and improves discoverability, but also helps address some of the issues that @yuliacech mentioned about users perhaps creating policies using the API. We also went through the copy in a live session with @debadair to double check that everything is alright on that end. I've also created a few ES issues to track some of the anomalies that were discovered while building this feature and listed them in the summary of this PR. |
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.
Great work @sabarasaba! I left a couple minor comments in the code.
When we retrieve the list of feature states from the installation it returns all of them even if they have no data to backup, which could be confusing for the user when they see no feature states in the resulting snapshot when they try to restore it. I've created the following issue for tracking that elastic/elasticsearch#86606
Thanks for opening this issue! I found this behavior quite confusing.
A few other things I noticed:
- When creating a new policy, and global state is enabled, I do not see it represented in the request. Technically, I think this is OK because global state is enabled by default. However, I think it'd be helpful to be explicit about this.
- From a design perspective, it seemed a little strange to have almost a double heading for feature states. Do we need the "Only from" part, or can it be incorporated into the top-level heading?
|
||
testBed = await setup(httpSetup); | ||
await nextTick(); |
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.
Thanks for cleaning this up!
x-pack/plugins/snapshot_restore/__jest__/client_integration/policy_add.test.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/snapshot_restore/__jest__/client_integration/policy_list.test.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/snapshot_restore/__jest__/client_integration/policy_list.test.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/snapshot_restore/__jest__/client_integration/policy_list.test.tsx
Outdated
Show resolved
Hide resolved
.../public/application/components/restore_snapshot_form/steps/step_logistics/step_logistics.tsx
Show resolved
Hide resolved
@@ -67,6 +67,11 @@ export const PolicyForm: React.FunctionComponent<Props> = ({ | |||
const [policy, setPolicy] = useState<SlmPolicyPayload>({ | |||
...originalPolicy, | |||
config: { | |||
// When creating a new policy includesGlobalState is enabled by default and the API will also |
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.
thanks for adding this comment 👍
Thanks for having a look @alisonelizabeth! I've addressed your feedback with 5b3dc19 |
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.
Thanks for addressing my feedback! Didn't retest, but code changes LGTM. Great work 🎉
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.
Left a suggestion for changing the stacked toggle & menu based on a convo with @gchaps, and her suggested label lets us drop the "from" language entirely.
...orm/steps/step_settings/fields/include_feature_states_field/include_feature_states_field.tsx
Outdated
Show resolved
Hide resolved
...orm/steps/step_settings/fields/include_feature_states_field/include_feature_states_field.tsx
Show resolved
Hide resolved
...t_restore/public/application/components/summaries/policies/policy_feature_states_summary.tsx
Outdated
Show resolved
Hide resolved
...t_restore/public/application/components/summaries/policies/policy_feature_states_summary.tsx
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.
Great work, @sabarasaba 🎉
Thanks a lot for addressing my feedback and also for creating issues to follow up with ES. For the list of all features that might not have any data to backup, we can maybe just mention that in the description. Otherwise, LGTM!
@elasticmachine merge upstream |
After speaking to @cristina-eleonora we ended up finding a couple of things that need to be improved UX wise, but they seem a bit out of scope for this PR. I created a new issue for tackling those #132211 |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @sabarasaba |
Fixes #120314 and #95128
Summary
This PR adds support for feature states in both policy creation and snapshot restoration and also thanks to elastic/elasticsearch#82671 we can now hide system indices from policy creation.
There is a few small oddities with the way the ES API's work with this feature:
featureStates: ['none']
is executed, the resulting snapshot will endup withfeatureStates: []
. This is very confusing as the api states that if the array is empty then it includes all features. I've created the following issue for tracking that MakefeatureStates
results more consistent when creating a snapshot elasticsearch#86605Release Note
With elastic/elasticsearch#63513 feature states were added to elasticsearch allowing users to backup system indices and other related state of certain features. Previously the user could only backup/restore all features or none by using the include global state feature. This PR adds support in kibana for allowing the user to select which features they want to backup/restore.
How to test
yarn es snapshot --license=trial -E path.repo=/tmp/es-backups
and kibana withyarn start
Stack Management
->Snapshot and Restore
->Policies
and create a new oneScreenshots policy creation
Screenshots snapshot restore