Cherry-pick #19102 to 7.x: Retryable downloads of beats #19156
Merged
michalpristas merged 2 commits intoelastic:7.xfrom Jun 12, 2020
Merged
Cherry-pick #19102 to 7.x: Retryable downloads of beats #19156michalpristas merged 2 commits intoelastic:7.xfrom
michalpristas merged 2 commits intoelastic:7.xfrom
Conversation
[Ingest Manager] Retryable downloads of beats (elastic#19102)
Contributor
|
Pinging @elastic/ingest-management (Team:Ingest Management) |
Contributor
blakerouse
approved these changes
Jun 12, 2020
Contributor
blakerouse
left a comment
There was a problem hiding this comment.
Looks good.
This should actually pass lint now that the GRPC switch has been backported to 7.x.
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.
Cherry-pick of PR #19102 to 7.x branch. Original message:
What does this PR do?
Background:
when agent downloads an artifact and checksum does not match it yields a failure, but then it might occur that when download is performed again due to new config or whatever, download is skipped (because download was successful for some reason or packed artifacts are invalid).
Agent cleans up downloaded artifact only in case download yields error. so if this does not yield error but artifact is corrupted we might end up in a loop because it will try to verify artifact it find out it's incorrect and continues with failure... and so on
This PR changes this behavior a bit.
In case Verify fails. it cleans up downloaded artifacts (artifact + hash).
It also introduces retryable block within operation flow.
In this case we know than=t download+verify might be error prone so we can retry them if failure happens. (only if retry.enabled == true)
What this means for agent is that when it tries to install from corrupted artifact, it will remove artifact during Verify and re-download it again.
Why is it important?
Make download scneario more robust and repair loop faster
Checklist
CHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.How to test
retry.enabled: trueSee it fails with packed artifact, waits 30s and then downloads artifact from web