fix: set ReportFullState flag in OpAMP responses on drift detection#6831
Draft
michel-laterman wants to merge 1 commit intoelastic:mainfrom
Draft
fix: set ReportFullState flag in OpAMP responses on drift detection#6831michel-laterman wants to merge 1 commit intoelastic:mainfrom
michel-laterman wants to merge 1 commit intoelastic:mainfrom
Conversation
Fleet-server now sets the ReportFullState flag in ServerToAgent responses when it detects sequence number gaps, new enrollments without full status, or reconnects from disconnected agents that don't report full state. The full status check is capability-aware per the OpAMP spec. Closes elastic#6783 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
This pull request is now in conflicts. Could you fix it @michel-laterman? 🙏 |
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.
What is the problem this PR solves?
Fleet-server does not use the OpAMP spec's
ServerToAgent.flags.ReportFullStateflag. When the server detects drift (sequence number gaps, incomplete first messages, or reconnects after disconnect), it has no way to ask the agent to resend its full status.How does this PR solve the problem?
Adds two functions to the OpAMP handler:
hasFullStatus: capability-aware check that verifies the message contains all expected fields.AgentDescriptionandHealthare always required.EffectiveConfig,RemoteConfigStatus,PackageStatuses,AvailableComponents, andConnectionSettingsStatusare required only when the correspondingReports*capability bit is set. Unset capabilities (0) always fail.shouldRequestFullState: returns true when theReportFullStateflag should be set:sequence_numis not exactlystored + 1sequence_num == 0without full statusThe flag is computed before
updateAgentand set on theServerToAgentresponse.How to test this PR locally
Design Checklist
Checklist
./changelog/fragmentsusing the changelog toolRelated issues