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

Fix Race in Concurrent Snapshot Delete and Create #37612

Conversation

original-brownbear
Copy link
Member

  • The repo id was determined wrong when the delete picked up on an in progress snapshot
    • NOTE: This solution is still a best-effort fix and there's a slight chance of running into concurrency issues here
      when multiple create and delete requests for the same snapshot name are happening concurrently, but these require a sequence
      of multiple cluster state updates between the changed method reading the genId and submitting its cluster state update task
  • Added test reproduced the issue reliably in about 50% of runs
  • Closes SnapshotIT testCreateSnapshot fails possibly due to simultaneous deletions #37581

* The repo id was determined wrong when the delete picked up on an in progress snapshot
  * NOTE: This solution is still a best-effort fix and there's a slight chance of running into concurrency issues here
when multiple create and delete requests for the same snapshot name are happening concurrently, but these require a sequence
of multiple cluster state updates between the changed method reading the genId and submitting its cluster state update task
* Added test reproduced the issue reliably in about 50% of runs
* Closes elastic#37581
@original-brownbear original-brownbear added >bug :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v7.0.0 v6.7.0 labels Jan 18, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

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. The new snapshots test infrastructure is already paying off.

@original-brownbear
Copy link
Member Author

@ywelsch thanks!

@original-brownbear original-brownbear merged commit 3a3f5b3 into elastic:master Jan 21, 2019
@original-brownbear original-brownbear deleted the fix-snapshot-delete-concurrency branch January 21, 2019 12:10
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Feb 28, 2019
* Backport of various snapshot stability fixes from `master` to `6.7`
* Includes elastic#38368, elastic#38025 and elastic#37612
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Feb 28, 2019
* Backport of various snapshot stability fixes from `master` to `6.7`
* Includes elastic#38368, elastic#38025 and elastic#37612
original-brownbear added a commit that referenced this pull request Mar 1, 2019
* Snapshot Stability Fixes

* Backport of various snapshot stability fixes from `master` to `6.7`
* Includes #38368, #38025 and #37612
original-brownbear added a commit that referenced this pull request Mar 4, 2019
* Backport of various snapshot stability fixes from `master` to `6.7` making the snapshot logic in `6.7` equivalent to that in `master` functionally
* Includes #38368, #38025 and #37612
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v6.7.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SnapshotIT testCreateSnapshot fails possibly due to simultaneous deletions
4 participants