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

Remove Redundant Cleanup Step in Snapshot Failure #54395

Conversation

original-brownbear
Copy link
Member

@original-brownbear original-brownbear commented Mar 30, 2020

Ever since we don't write any data to the repo during
snapshot initialization (#45689), the snapshotCreated flag has become obsolete.
If we run into any exception during snapshot init we should not redundantly
finalize an empty snapshot in the repository.

Note: in the backport to 7.x we can't fully remove this logic because we still have to support rolling upgrades mixed with older versions that write some data to the repository during snapshot init but we can clean up the logic there as well to not run finalization if nothing was written to the repository yet (the way the flag was intended to function initially anyway).

Ever since we don't write any data to the repo during
snapshot initialization, the `snapshotCreated` flag has become obsolete.
If we run into any exception during snapshot init we should not redundantly
finalize an empty snapshot in the reopsitory.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore)

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@original-brownbear
Copy link
Member Author

Thanks Yannick!

@original-brownbear original-brownbear merged commit 58af49b into elastic:master Mar 30, 2020
@original-brownbear original-brownbear deleted the shorter-error-handling-begin-snapshot branch March 30, 2020 11:09
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Mar 30, 2020
Similar to elastic#54395 we know that a snapshot in INIT state has not
written anything to the repository yet. If we see one from a master
failover, there is no point in moving it to ABORTED before removing it
from the cluster state in a subsequent CS update.
Instead, we can simply remove its job from the CS the first time
we see it on master failover and be done with it.
original-brownbear added a commit that referenced this pull request Mar 30, 2020
…#54420)

* Remove Redundant Cluster State during Snapshot INIT + Master Failover

Similar to #54395 we know that a snapshot in INIT state has not
written anything to the repository yet. If we see one from a master
failover, there is no point in moving it to ABORTED before removing it
from the cluster state in a subsequent CS update.
Instead, we can simply remove its job from the CS the first time
we see it on master failover and be done with it.
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Apr 15, 2020
…elastic#54420)

* Remove Redundant Cluster State during Snapshot INIT + Master Failover

Similar to elastic#54395 we know that a snapshot in INIT state has not
written anything to the repository yet. If we see one from a master
failover, there is no point in moving it to ABORTED before removing it
from the cluster state in a subsequent CS update.
Instead, we can simply remove its job from the CS the first time
we see it on master failover and be done with it.
original-brownbear added a commit that referenced this pull request Apr 15, 2020
…#54420) (#55208)

* Remove Redundant Cluster State during Snapshot INIT + Master Failover (#54420)

Similar to #54395 we know that a snapshot in INIT state has not
written anything to the repository yet. If we see one from a master
failover, there is no point in moving it to ABORTED before removing it
from the cluster state in a subsequent CS update.
Instead, we can simply remove its job from the CS the first time
we see it on master failover and be done with it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants