Skip to content

ROX-32721: Switch SearchListAlerts and WalkAll to column projection#20032

Draft
dashrews78 wants to merge 4 commits intodashrews/migration-32721from
dashrews/projection-read-path-32721
Draft

ROX-32721: Switch SearchListAlerts and WalkAll to column projection#20032
dashrews78 wants to merge 4 commits intodashrews/migration-32721from
dashrews/projection-read-path-32721

Conversation

@dashrews78
Copy link
Copy Markdown
Contributor

ROX-32721: Switch SearchListAlerts and WalkAll to column projection

Replace the blob deserialization path (GetByQueryFn + AlertToListAlert)
with direct column projection via RunSelectDirectFn. All 24 ListAlert
fields are now read from indexed columns using pgtype value types,
avoiding both protobuf deserialization and scany reflection overhead.

Benchmarks show 2-3x latency improvement and ~8x memory reduction
compared to the blob-based approach.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

ROX-32721: Add entity type coverage tests for SearchListAlerts projection

Verify that the column projection correctly handles deployment, resource,
and node entity types, including deployment_type, enforcement_count, and
categories array fields.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Description

change me!

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

change me!

@dashrews78
Copy link
Copy Markdown
Contributor Author

dashrews78 commented Apr 15, 2026

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 15, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

🚀 Build Images Ready

Images are ready for commit 6c37101. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.11.x-669-g6c371011fb

@dashrews78 dashrews78 force-pushed the dashrews/migration-32721 branch from c70f096 to 5413be2 Compare April 15, 2026 19:21
@dashrews78 dashrews78 force-pushed the dashrews/projection-read-path-32721 branch from 70d5ded to 1cd7edd Compare April 15, 2026 19:22
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 81.17155% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.66%. Comparing base (cd5e37e) to head (6c37101).

Files with missing lines Patch % Lines
central/alert/datastore/datastore_impl.go 81.17% 43 Missing and 2 partials ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##           dashrews/migration-32721   #20032      +/-   ##
============================================================
+ Coverage                     49.62%   49.66%   +0.03%     
============================================================
  Files                          2767     2767              
  Lines                        208950   209178     +228     
============================================================
+ Hits                         103693   103878     +185     
- Misses                        97568    97608      +40     
- Partials                       7689     7692       +3     
Flag Coverage Δ
go-unit-tests 49.66% <81.17%> (+0.03%) ⬆️

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

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

dashrews78 and others added 3 commits April 16, 2026 07:12
Replace the blob deserialization path (GetByQueryFn + AlertToListAlert)
with direct column projection via RunSelectDirectFn. All 24 ListAlert
fields are now read from indexed columns using pgtype value types,
avoiding both protobuf deserialization and scany reflection overhead.

Benchmarks show 2-3x latency improvement and ~8x memory reduction
compared to the blob-based approach.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tion

Verify that the column projection correctly handles deployment, resource,
and node entity types, including deployment_type, enforcement_count, and
categories array fields.

Partially generated by AI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PostgreSQL stores timestamps with microsecond precision, but protobuf
timestamps have nanosecond precision. Round both expected and actual
timestamps to microsecond before comparing to avoid CI flakiness.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dashrews78 dashrews78 force-pushed the dashrews/migration-32721 branch from 5413be2 to cd5e37e Compare April 16, 2026 11:13
@dashrews78 dashrews78 force-pushed the dashrews/projection-read-path-32721 branch from 1cd7edd to a701f5f Compare April 16, 2026 11:13
When set to true, SearchListAlerts and WalkAll revert to the original
blob deserialization path (GetByQueryFn + AlertToListAlert) instead of
the column projection path. This provides an escape hatch if the
projection path causes unforeseen issues in production.

Defaults to false (projection path active).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant