Skip to content

Conversation

@hawkw
Copy link
Member

@hawkw hawkw commented Dec 8, 2025

Cases, as described in RFD 603, give diagnosis engines a mechanism to group together ereports (and eventually, other fault management data) as part of a sitrep. This branch adds database tables for representing cases, and for associating ereports with cases. Subsequent branches will add a mechanism for sitreps to request alerts, which will also be associated with cases.

This branch was factored out from #9346, where I've been prototyping a diagnosis engine implementation. Although aspects of how the DEs themselves will work are still in flux, I think that cases, along with other parts of the database machinery such as the impending alert-requests branch, are pretty much nailed down.

@hawkw hawkw requested review from jgallagher and smklein December 8, 2025 23:45
@hawkw hawkw added the fault-management Everything related to the fault-management initiative (RFD480 and others) label Dec 8, 2025
@hawkw hawkw self-assigned this Dec 8, 2025
@hawkw
Copy link
Member Author

hawkw commented Dec 9, 2025

This failure installing rustc components in the helios / build TUF repo job is almost certainly not my fault; I've restarted it

Comment on lines +269 to +270
// TODO(eliza): we should populate cases and assert they get
// cleaned up...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we're adding deletion operations in this PR -- WDYT about addressing this comment before we merge?


comment TEXT NOT NULL,

PRIMARY KEY (sitrep_id, id)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Interesting; I would have figured the id would be the PK, but I'm not opposed to it being (sitrep_id, id) either.

Copy link
Member Author

Choose a reason for hiding this comment

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

the ID can't be the PK on its own since we would like to be able to insert a new sitrep non-transactionally without having removed the previous one, and we need to know the sitrep ID so that we can delete the records associated with it when GCing old/orphaned sitreps.

Copy link
Member Author

Choose a reason for hiding this comment

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

actually, hmm, perhaps there is a way to have these records not contain the current sitrep ID, and GC them separately? that might make this table a lot smaller. i'd have to think about it.

Comment on lines +218 to +219
map.entry(case_id).or_default().insert_unique(
fm::case::CaseEreport {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Woah this is weird formatting

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

Labels

fault-management Everything related to the fault-management initiative (RFD480 and others)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants