Skip to content

Cherry pick: Fixed unreleased Windows cert ingestion perf issue (#49787)#49847

Merged
getvictor merged 1 commit into
rc-minor-fleet-v4.90.0from
victor/49705-cherry-pick
Jul 23, 2026
Merged

Cherry pick: Fixed unreleased Windows cert ingestion perf issue (#49787)#49847
getvictor merged 1 commit into
rc-minor-fleet-v4.90.0from
victor/49705-cherry-pick

Conversation

@getvictor

Copy link
Copy Markdown
Member

Related issue: Resolves #49705

Verified fix with 100k host Windows load test.

Checklist for submitter

Testing

For unreleased bug fixes in a release candidate, one of:

  • Alerted the release DRI if additional load testing is needed

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes
  • Improved host certificate deduplication and automated self-healing when duplicate certificate records are ingested.
  • Updated source reconciliation to only change what’s stale, preventing unnecessary rewrites of unchanged source entries.
  • Ensured certificate sources consistently associate to the newest canonical certificate record for each certificate hash.
  • Improved certificate listing accuracy by returning a deduplicated set of certificate/source pairs with correct usernames.

(cherry picked from commit f72de68)

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #49705

Verified fix with 100k host Windows load test.

# Checklist for submitter

## Testing

- [x] Added/updated automated tests
- [x] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually

For unreleased bug fixes in a release candidate, one of:

- [x] Alerted the release DRI if additional load testing is needed

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

* **Bug Fixes**
* Improved host certificate deduplication and automated self-healing
when duplicate certificate records are ingested.
* Updated source reconciliation to only change what’s stale, preventing
unnecessary rewrites of unchanged source entries.
* Ensured certificate sources consistently associate to the newest
canonical certificate record for each certificate hash.
* Improved certificate listing accuracy by returning a deduplicated set
of certificate/source pairs with correct usernames.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

(cherry picked from commit f72de68)
@getvictor
getvictor marked this pull request as ready for review July 23, 2026 18:20
@getvictor
getvictor requested a review from a team as a code owner July 23, 2026 18:20
@getvictor
getvictor requested a review from nulmete July 23, 2026 18:20
@getvictor
getvictor merged commit 78677aa into rc-minor-fleet-v4.90.0 Jul 23, 2026
23 checks passed
@getvictor
getvictor deleted the victor/49705-cherry-pick branch July 23, 2026 18:32
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.54430% with 13 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (rc-minor-fleet-v4.90.0@987dca0). Learn more about missing BASE report.

Files with missing lines Patch % Lines
server/datastore/mysql/host_certificates.go 83.54% 6 Missing and 7 partials ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##             rc-minor-fleet-v4.90.0   #49847   +/-   ##
=========================================================
  Coverage                          ?   67.87%           
=========================================================
  Files                             ?     3890           
  Lines                             ?   248272           
  Branches                          ?    12967           
=========================================================
  Hits                              ?   168527           
  Misses                            ?    64539           
  Partials                          ?    15206           
Flag Coverage Δ
backend 69.29% <83.54%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants