Reconcile orphaned output secrets after agent update failures - #7534
Conversation
b3f11ce to
594fc1f
Compare
This comment has been minimized.
This comment has been minimized.
TL;DRThe integration-test Buildkite step failed ( Remediation
Investigation detailsRoot CauseFrom the available artifact, the failure is inconclusive: all visible tests are passing, then the log ends with a bare Evidence
Verification
Follow-up
What is this? | From workflow: PR Buildkite Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
|
@Mergifyio backport 9.5 9.4 9.3 8.19 |
✅ Backports have been createdDetails
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
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
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
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 |
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.