-
Notifications
You must be signed in to change notification settings - Fork 25k
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
validate snapshot has global state before restoring #82037
validate snapshot has global state before restoring #82037
Conversation
It is possible to restore from a snapshot with a global state even if it does not have one. This pr adds validation for this case.
Pinging @elastic/es-distributed (Team:Distributed) |
@@ -158,7 +158,7 @@ public void testIncludeGlobalState() throws Exception { | |||
logger.info("--> try restoring cluster state from snapshot without global state"); |
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 should revisit the log entries as well
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 Ievgen, this looks good. I would like to add documentation to the restore page explaining that you can only restore global state if the snapshot was taken with global state. Also, I wonder if we should not list it as breaking, only to highlight this to the few users who might be impacted.
server/src/main/java/org/elasticsearch/snapshots/RestoreService.java
Outdated
Show resolved
Hide resolved
@@ -170,6 +170,9 @@ ingest pipelines and {ilm-init} lifecycle policies that exist in your cluster | |||
and replaces them with the corresponding items from the snapshot. | |||
|
|||
Use the `feature_states` parameter to configure how feature states are restored. | |||
|
|||
If `include_global_state` is `true` and a snapshot was created without a global | |||
state then restore will fail. |
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.
@henningandersen please let me know if you have ideas as for other sections this note should be added to
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.
docs/reference/snapshot-restore/apis/restore-snapshot-api.asciidoc
Outdated
Show resolved
Hide resolved
…idoc Co-authored-by: Henning Andersen <[email protected]>
💔 Backport failed
You can use sqren/backport to manually backport by running |
It is possible to restore from a snapshot with a global state even if it does not have one. This pr adds validation to prevent this from happening. (cherry picked from commit e7d8991)
Currently it is possible to restore with
include_global_state: true
from a snapshot that does not have a global state.This behavior will nullify cluster state once #81373 is merged.
This pr adds explicit validation and error message to prevent damaging cluster state.
closes #82019