Skip to content

fixes ordering of cache events - #7189

Merged
sorindumitru merged 1 commit into
spiffe:mainfrom
nweisenauer-sap:fix-event-list-ordering
Aug 4, 2026
Merged

sorindumitru merged 1 commit into
spiffe:mainfrom
nweisenauer-sap:fix-event-list-ordering

Conversation

@nweisenauer-sap

Copy link
Copy Markdown
Contributor

Summary

Addresses a root cause of the false skipped-event growth seen in #7181.
The events-based cache assumes List*Events returns rows ordered by ID and tracks every gap as a potentially late event.
With GORM v1, Find() executes immediately, so the existing trailing Order("id asc") had no effect.
An unordered startup scan can therefore classify a large portion of the event table as missing.
This causes unnecessary event lookups and can delay normal cache-update processing.
Apply Order("id asc") before Find() for attested-node and registration-entry event queries.

Pull Request check list

  • Commit conforms to CONTRIBUTING.md?
  • Proper tests/regressions included?
  • Documentation updated?

Affected functionality

Description of change

Which issue this PR fixes
fixes #7181

- applies ordering before GORM executes the event query

Signed-off-by: nweisenauer-sap <[email protected]>

@sorindumitru sorindumitru left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nweisenauer-sap! This matches what the docs specify, so LGTM

@sorindumitru
sorindumitru enabled auto-merge August 4, 2026 18:28
@sorindumitru
sorindumitru added this pull request to the merge queue Aug 4, 2026
Merged via the queue into spiffe:main with commit b8d4451 Aug 4, 2026
105 of 107 checks passed
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.

Skipped event ID spikes after full cache rebuild delay SVID issuance (part 2)

3 participants