-
Notifications
You must be signed in to change notification settings - Fork 148
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
Track upgrade details #3527
Merged
Merged
Track upgrade details #3527
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
0f02a50
Remove context and handle cancellation internally instead
ycombinator 0b91b11
More optimizations
ycombinator af56f61
Add back context
ycombinator f6396be
Adding FSM for upgrades
ycombinator f68c6af
Implementing TODO
ycombinator c730a30
WIP
ycombinator 41e2bc8
WIP
ycombinator 66e57b9
Reorganizing imports
ycombinator 47d05bb
Running go mod tidy
ycombinator bf47f0c
Resolve deadlock
ycombinator 171b115
Add unit tests
ycombinator 394650d
Fix type
ycombinator a39e204
Renaming variable to avoid conflict with package name
ycombinator 539313f
Handle failures in one place
ycombinator 55164c6
Set UPG_RESTARTING state
ycombinator d029c23
Remove Fleet changes
ycombinator 101bf97
Add guard for action
ycombinator c8fb1fa
Immediately notify observer when registered
ycombinator a0e6b6b
Add UpgradeCompleted effect to observer doc
ycombinator 4d509c7
Fix initialization
ycombinator a60bd94
Adding details progress observer and unit tests
ycombinator 0673107
Fixing booboos introduced during conflict resolution
ycombinator a5489d6
Add unit test
ycombinator 1d76472
Add assertion on error
ycombinator 898ba0e
Add comment on stateNeedsRefresh
ycombinator 761e2fe
Add comment linking to Fleet Server OpenAPI spec for UPG_* values
ycombinator 5df99f3
Use public accessor for setting upgrade details on coordinator to pre…
ycombinator a479063
Use buffered channel for upgradeDetailsChan in test so test can run i…
ycombinator 8fe8499
Fixing unit test
ycombinator 94cc5ab
Add mutex to prevent data race
ycombinator e7d3401
Clarify assertion's intent
ycombinator 413959c
Make copy of details before notifying observer with it.
ycombinator 11dca0b
Add setter for setting download percent
ycombinator 52fa242
Remove unnecessary struct tags
ycombinator 3029e0f
Change mutex type
ycombinator 8eae498
Document FailedState and ErrorMsg fields
ycombinator 3ac886c
Track download rate as well
ycombinator db2eb60
Change data type of time field
ycombinator 7d20b9f
Rename struct to avoid stutter in naming
ycombinator abefefa
Log upgrade details when they change
ycombinator 492d195
Add nil guard
ycombinator 6db2a99
Setting logger in test
ycombinator 29afff0
Use sentinel value for encoding +Inf download rate in JSON
ycombinator 6b3719b
Fix up comment
ycombinator 26d2dd6
Set omitempty on failed_state and error_msg
ycombinator 52987e7
Add units to download rate
ycombinator b8d81a0
Fixing test after conflicts
ycombinator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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 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 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 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 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
Oops, something went wrong.
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.
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.
Should we be logging every upgrade details transition? This seems like great way to make upgrade progress obvious in our logs.
Fleet is only going to get the latest state at the time of the next checkin, it won't see the entire set of transitions.
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.
Good idea, will add logging to this PR.
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.
I added logging but I implemented it as just another observer that's registered with the
UpgradeDetails
object. See d2a2eff.Here's what the result looks like in Agent logs:
BTW, that last entry is from me Ctrl-C'ing the
sudo elastic-agent upgrade 8.13.0
command since I knew it would never succeed.Let me know what you think. Thanks!