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
Rework repository.StreamPacks & better restorer error handling #4605
Merged
MichaelEischer
merged 5 commits into
restic:master
from
MichaelEischer:better-restorer-error-handling
May 1, 2024
Merged
Rework repository.StreamPacks & better restorer error handling #4605
MichaelEischer
merged 5 commits into
restic:master
from
MichaelEischer:better-restorer-error-handling
May 1, 2024
Conversation
This file contains 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
This was referenced Jan 7, 2024
MichaelEischer
force-pushed
the
better-restorer-error-handling
branch
from
January 19, 2024 21:05
43df83d
to
3cacc80
Compare
Try to retrieve individual blobs via LoadBlob if streaming did not work.
MichaelEischer
force-pushed
the
better-restorer-error-handling
branch
from
April 21, 2024 19:36
3cacc80
to
621012d
Compare
Due to the interface of streamPack, we cannot guarantee that operations progress fast enough that the underlying connections remains open. This introduces partial failures which massively complicate the error handling. Switch to a simpler approach that retrieves the pack in chunks of 32MB. If a blob is larger than this limit, then it is downloaded separately. To avoid multiple copies in memory, an auxiliary interface `discardReader` is introduced that allows directly accessing the downloaded byte slices, while still supporting the streaming used by the `check` command.
With most cloud providers, traffic is much more expensive than API calls. Thus slightly bias streamPack towards a bit more API calls in exchange for slightly less traffic.
MichaelEischer
force-pushed
the
better-restorer-error-handling
branch
from
April 22, 2024 19:21
58edc5c
to
20d8eed
Compare
8 tasks
MichaelEischer
commented
May 1, 2024
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.
7 tasks
7 tasks
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.
What does this PR change? What problem does it solve?
restore
reports too many errors if a pack file can only be partially loaded. In addition, the restore progress bar is incorrect if restoring blobs from a pack file has to be retried. The PR reworks the error reporting and makesStreamPack
(nowLoadBlobsFromPack
) easier to use and far more reliable. Blobs that cannot be loaded while streaming a pack file are now additionally loaded individually.Was the change previously discussed in an issue or on the forum?
Partially fixes https://forum.restic.net/t/errors-restoring-with-restic-on-windows-server-s3/6943
Checklist
[ ] I have added documentation for relevant changes (in the manual).changelog/unreleased/
that describes the changes for our users (see template).gofmt
on the code in all commits.