Restore from Individual Shard Snapshot Files in Parallel#48110
Merged
original-brownbear merged 49 commits intoelastic:masterfrom Oct 30, 2019
original-brownbear:async-restore
Merged
Restore from Individual Shard Snapshot Files in Parallel#48110original-brownbear merged 49 commits intoelastic:masterfrom original-brownbear:async-restore
original-brownbear merged 49 commits intoelastic:masterfrom
original-brownbear:async-restore
Conversation
Collaborator
|
Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore) |
The code here was needlessly complicated when it enqueued all file uploads up-front. Instead, we can go with a cleaner worker + queue pattern here by taking the max-parallelism from the threadpool info. Also, I slightly simplified the rethrow and listener (step listener is pointless when you add the callback in the next line) handling it since I noticed that we were needlessly rethrowing in the same code and that wasn't worth a separate PR.
dnhatn
reviewed
Oct 29, 2019
Member
dnhatn
left a comment
There was a problem hiding this comment.
I understand the patch, and it looks great to me. However, I am not familiar enough with the codebase to LGTM. Thanks Armin.
Contributor
Author
|
Jenkins run elasticsearch-ci/2 (unrelated ML failure) |
Contributor
Author
|
Thanks all! |
original-brownbear
added a commit
that referenced
this pull request
Oct 30, 2019
This was referenced Nov 1, 2019
original-brownbear
added a commit
that referenced
this pull request
Nov 1, 2019
With the changes in #48110 there is no more need to block a generic thread when waiting for the multi file transfer in `CcrRepository`.
original-brownbear
added a commit
that referenced
this pull request
Nov 1, 2019
original-brownbear
added a commit
that referenced
this pull request
Nov 2, 2019
Follow up to #48110 cleaning up the redundant future uses that were left over from that change.
original-brownbear
added a commit
that referenced
this pull request
Nov 2, 2019
This was referenced Feb 3, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The code in this PR is rather to illustrate the amount of change necessary to allow for faster restores and demonstrate required code changes than for review as it does not limit concurrency in any way.
In #42791 we fixed the order in which files are uploaded to snapshots, making snapshots upload the individual file for each shard in parallel and working shard-by-shard in terms of ordering the uploads for various shards in the snapshot.
For restores from snapshots however we currently run all shards in parallel using only a single thread per shard for downloading files. This is needlessly inefficient and significantly slows down restores from Cloud repositories.
I think we should move to the same ordering for restores. Parallelize by files and order by shards.
This should significantly speed up restores for shards (especially those with many files) as well as speed up the restore process end-to-end since if we order by shards we restore the first primaries more quickly and thus the replica recovery can run in parallel to the restore in a more efficient manner.