[9.5](backport #7534) Reconcile orphaned output secrets after agent update failures - #7549
Closed
mergify[bot] wants to merge 5 commits into
Closed
[9.5](backport #7534) Reconcile orphaned output secrets after agent update failures#7549mergify[bot] wants to merge 5 commits into
mergify[bot] wants to merge 5 commits into
Conversation
(cherry picked from commit 229f161) # Conflicts: # internal/pkg/policy/policy_output.go # internal/pkg/policy/policy_output_test.go # internal/pkg/server/fleet.go
Contributor
Author
|
Cherry-pick of 229f161 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
5 tasks
This comment has been minimized.
This comment has been minimized.
- policy_output.go: drop the orphaned-secret enqueue block (secretID/apiKeyRef not defined in 9.5) - policy_output_test.go: drop the two new test cases that depend on secrets feature - fleet.go: include outputSecretReconciler goroutine but omit rate-sampler goroutines that don't exist in 9.5
This comment has been minimized.
This comment has been minimized.
ycombinator
previously approved these changes
Aug 4, 2026
…ranch The OrphanedOutputSecretReconciler references bulk.DeleteSecret, model.ToRetireAPIKeyIdsItems.SecretID, and secret.ParseSecretReference, which are part of the secrets write/delete feature not yet available in this branch. Since output secrets are also never written in this branch, orphaned secrets cannot occur and the reconciler is not needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…anch Revert the collector types and option machinery introduced by the cherry-pick. Since neither WriteSecret nor DeleteSecret is available in this branch, output secrets are never created or deleted, so all the collector wiring is dead code and triggers lint failures. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
TL;DRBuildkite build 16064 failed in Remediation
Investigation detailsRoot CauseThis is a backport conflict resolution mismatch in an intermediate PR commit:
Evidence
Additional PR evidence:
Verification
Follow-up
What is this? | From workflow: PR Buildkite Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
Contributor
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?
#7533 prevents an ambiguous
.fleet-agentsupdate failure from deleting a secret that Elasticsearch may already have referenced. The safe failure behavior can leave an orphaned.fleet-secretsdocument when the update truly did not commit.This failure mode was observed under load during a 100k-agent scale test.
How does this PR solve the problem?
Add an out-of-band, candidate-based reconciler:
Candidates intentionally do not survive a Fleet Server restart. A restart during the reconciliation window can therefore leave an orphaned secret, but cannot damage an agent by deleting a referenced secret.
This PR is stacked on and depends on #7533. Its implementation is the second commit (
b3f11ce9). Once #7533 merges, GitHub will remove the shared first commit from this PR's diff.How to test
go test ./internal/pkg/policy ./internal/pkg/gc ./internal/pkg/api ./internal/pkg/servermage test:unitmage check:allcurrently reports the same 58 pre-existing linter findings as #7533 in unrelated files. None are in files changed by this PR.Design Checklist
Checklist
CHANGELOG.mdConfiguration changes are not applicable. Package documentation was updated and the changelog entry is supplied as a fragment.
This is an automatic backport of pull request #7534 done by [Mergify](https://mergify.com).