Skip to content

[2/n][fm] factor restart_id and time_created out of EreportData#10631

Merged
hawkw merged 6 commits into
mainfrom
eliza/restart-order-ereport-refactor
Jun 25, 2026
Merged

[2/n][fm] factor restart_id and time_created out of EreportData#10631
hawkw merged 6 commits into
mainfrom
eliza/restart-order-ereport-refactor

Conversation

@hawkw

@hawkw hawkw commented Jun 16, 2026

Copy link
Copy Markdown
Member

Depends on #10618

This is a small refactor which I discussed in this comment on #10618. As part of that branch, I changed the DataStore::ereports_insert method to take the restart ID and time_collected timestamp as arguments to the method, since they are used for populating the restart entry. This results in the same values also being passed as part of the EreportData structs that represent the individual ereports to insert. This is unfortunate because it results in having to duplicate those values, but more importantly, because it allows them to differ when they should always be the same. This branch fixes that.

@hawkw hawkw added the fault-management Everything related to the fault-management initiative (RFD480 and others) label Jun 18, 2026
Base automatically changed from eliza/ereport-restart-order-v2-final to main June 18, 2026 21:25
@hawkw hawkw force-pushed the eliza/restart-order-ereport-refactor branch from 6242a48 to 0b4a9d2 Compare June 18, 2026 22:18
@hawkw hawkw requested a review from smklein June 18, 2026 22:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Refactors FM ereport ingestion/types to avoid duplicating restart_id and time_collected across each per-ereport payload, ensuring those values cannot diverge within a single insertion batch (aligning with the ereporter_restart “first-seen” table approach introduced in #10618).

Changes:

  • Move id, time_collected, and collector_id from EreportData onto the top-level Ereport.
  • Change EreportData::from_sp_ereport to return (Ena, EreportData) and update DataStore::ereports_insert to accept (Ena, EreportData) pairs plus a single collector_id.
  • Update affected call sites and tests across Nexus and support-bundle collection.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
support-bundle-collection/src/steps/ereports.rs Switches path construction to use ereport.id after moving ID out of EreportData.
nexus/types/src/fm/ereport.rs Restructures FM ereport types: lifts id/time_collected/collector_id to Ereport; adjusts SP conversion helper return type.
nexus/types/src/fm/case.rs Updates FM case tests to construct Ereport with top-level ID/time/collector fields.
nexus/src/app/background/tasks/support_bundle_collector.rs Updates test fixture inserts to the new ereports_insert API and tuple-based ereport inputs.
nexus/src/app/background/tasks/fm_rendezvous.rs Updates rendezvous task tests to the new ereport construction and insert API (IDs now separate from data).
nexus/src/app/background/tasks/ereport_ingester.rs Adapts ingester to new SP conversion return type and passes collector_id explicitly to ereports_insert.
nexus/fm/src/test_util.rs Updates test utility to build Ereport with top-level ID/time/collector fields; adapts to SP conversion tuple return.
nexus/db-queries/src/db/datastore/fm.rs Updates FM datastore tests for new Ereport::new signature and new ereports_insert tuple input format.
nexus/db-queries/src/db/datastore/ereport.rs Updates datastore insert API signature, call sites, and tests to use a single collector_id and (Ena, EreportData) items.
nexus/db-model/src/ereport.rs Updates DB model constructors/conversions to match the new types::Ereport / types::EreportData split.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nexus/types/src/fm/ereport.rs
@hawkw hawkw requested a review from mergeconflict June 25, 2026 20:11
@@ -19,6 +19,10 @@ pub use ereport_types::{Ena, EreportId};

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Ereport {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It might be useful to document what fields make sense to appear on Ereport vs. on EreportData. If I understand correctly, the idea is that EreportData is the actual "payload" of the ereport, created by the ereport's producer, whereas Ereports other fields are specific to Nexus's ingestion and bookkeeping of ereports. Is that right?

Comment thread nexus/types/src/fm/ereport.rs Outdated
Comment on lines 52 to 54
pub fn id(&self) -> &EreportId {
&self.data.id
&self.id
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: maybe this function is less useful now?

@hawkw hawkw enabled auto-merge (squash) June 25, 2026 21:22
@hawkw hawkw merged commit 8eb9253 into main Jun 25, 2026
18 checks passed
@hawkw hawkw deleted the eliza/restart-order-ereport-refactor branch June 25, 2026 22:08
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