Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
319da58
okay i think this might actually work
hawkw Jun 12, 2026
b2fff05
diesel hell
hawkw Jun 12, 2026
5602f03
okay get the latest query in there too
hawkw Jun 12, 2026
972cfc2
move stuff into other stuff
hawkw Jun 12, 2026
675e2ed
okay i can't quite get the latest query inlined into the CTE, that's
hawkw Jun 12, 2026
c98befb
whoa it actually works
hawkw Jun 12, 2026
7aa683a
have a restart list query
hawkw Jun 12, 2026
7cd919c
let's have some tests for that as well
hawkw Jun 13, 2026
3cbade2
clean up `ereports_insert_query`
hawkw Jun 13, 2026
7e29d33
migration, index, constraints
hawkw Jun 15, 2026
92ebeb5
actually nothing is using the slot index
hawkw Jun 15, 2026
68a2f39
wip add to loader
hawkw Jun 15, 2026
82c5cb4
finish loader
hawkw Jun 15, 2026
3732a29
gotta also add it here
hawkw Jun 15, 2026
9f1437b
data migration test
hawkw Jun 15, 2026
91df26b
Merge branch 'main' into eliza/ereport-restart-order-v2-final
hawkw Jun 16, 2026
dd76be4
update omdb command to use restart table as authortiative source
hawkw Jun 16, 2026
97a5487
Merge branch 'main' into eliza/ereport-restart-order-v2-final
hawkw Jun 16, 2026
30d72f2
issue warnings for ereports with unknown restart IDs
hawkw Jun 16, 2026
6b157b2
post merge test fixup
hawkw Jun 16, 2026
c063bd2
nexus-fm now depends on a db type sigh
hawkw Jun 16, 2026
6269baa
restart query will also do a full scan
hawkw Jun 16, 2026
efe895f
you have to actually get the rpaths thing correct lol
hawkw Jun 16, 2026
8b01405
fix typo in migration test
hawkw Jun 16, 2026
0b96394
some commentary improvements
hawkw Jun 16, 2026
4de2c50
remove some dead code
hawkw Jun 16, 2026
875fc5b
BLERGH THERES EVEN MORE COPY PASTE MISTAKES IN HERE
hawkw Jun 16, 2026
59cc9fb
UGH I TYPED THE WRONG ONE KMS KMS KMS KMS
hawkw Jun 16, 2026
f9f2e34
fixup omdb db ereport reporters arguments, some expectorates
hawkw Jun 16, 2026
30add8f
sketching out some structure
hawkw Jun 4, 2026
45bbcad
test ereports
hawkw Jun 4, 2026
17f6452
wip
hawkw Jun 4, 2026
f3346c6
have some alerts
hawkw Jun 17, 2026
5d481c6
tweaking alert classes
hawkw Jun 9, 2026
593469c
add alert types (wip)
hawkw Jun 9, 2026
18da220
fix trailing comma
hawkw Jun 11, 2026
ccb8fae
stuff for parsing ereports
hawkw Jun 17, 2026
d5bf5b5
reticulating
hawkw Jun 17, 2026
5c851c3
allow cases to impact multiple rectifiers/shelves
hawkw Jun 17, 2026
11a4eb2
reticulating
hawkw Jun 17, 2026
937eedb
reticulating indices
hawkw Jun 17, 2026
86c41bd
new ereports should be arced
hawkw Jun 17, 2026
e80aecb
reticulating
hawkw Jun 17, 2026
f170ee0
reticulating
hawkw Jun 17, 2026
1f34068
Merge branch 'main' into eliza/rectifier-i-hardly-knew-er
hawkw Jun 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions nexus/db-model/src/alert_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ impl_enum_type!(
TestFooBaz => b"test.foo.baz"
TestQuuxBar => b"test.quux.bar"
TestQuuxBarBaz => b"test.quux.bar.baz"
PsuInserted => b"hardware.power_shelf.psu.insert"
PsuRemoved => b"hardware.power_shelf.psu.remove"
);

impl AlertClass {
Expand Down Expand Up @@ -62,6 +64,8 @@ impl From<nexus_types::alert::AlertClass> for AlertClass {
In::TestFooBaz => Self::TestFooBaz,
In::TestQuuxBar => Self::TestQuuxBar,
In::TestQuuxBarBaz => Self::TestQuuxBarBaz,
In::PsuInserted => Self::PsuInserted,
In::PsuRemoved => Self::PsuRemoved,
}
}
}
Expand All @@ -75,6 +79,8 @@ impl From<AlertClass> for nexus_types::alert::AlertClass {
AlertClass::TestFooBaz => Self::TestFooBaz,
AlertClass::TestQuuxBar => Self::TestQuuxBar,
AlertClass::TestQuuxBarBaz => Self::TestQuuxBarBaz,
AlertClass::PsuInserted => Self::PsuInserted,
AlertClass::PsuRemoved => Self::PsuRemoved,
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion nexus/db-model/src/schema_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::{collections::BTreeMap, sync::LazyLock};
///
/// This must be updated when you change the database schema. Refer to
/// schema/crdb/README.adoc in the root of this repository for details.
pub const SCHEMA_VERSION: Version = Version::new(272, 0, 0);
pub const SCHEMA_VERSION: Version = Version::new(273, 0, 0);

/// List of all past database schema versions, in *reverse* order
///
Expand All @@ -28,6 +28,7 @@ pub static KNOWN_VERSIONS: LazyLock<Vec<KnownVersion>> = LazyLock::new(|| {
// | leaving the first copy as an example for the next person.
// v
// KnownVersion::new(next_int, "unique-dirname-with-the-sql-files"),
KnownVersion::new(273, "psu-presence-alert-classes"),
KnownVersion::new(272, "ereporter-restart-order-v2"),
KnownVersion::new(271, "inv-fmd"),
KnownVersion::new(270, "fm-alert-resource-deletion"),
Expand Down
1 change: 1 addition & 0 deletions nexus/fm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pq-sys = "*"
rand.workspace = true
serde.workspace = true
serde_json.workspace = true
strum.workspace = true
slog.workspace = true
slog-error-chain.workspace = true
thiserror.workspace = true
Expand Down
8 changes: 4 additions & 4 deletions nexus/fm/src/analysis_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub struct Input {
inv: Arc<inventory::Collection>,
/// Ereports which are new and should be input to analysis in the next
/// sitrep.
new_ereports: IdOrdMap<fm::Ereport>,
new_ereports: IdOrdMap<Arc<fm::Ereport>>,
open_cases: IdOrdMap<fm::Case>,
closed_cases_copied_forward: IdOrdMap<fm::Case>,
ereporter_restarts: IdOrdMap<EreporterRestart>,
Expand All @@ -63,7 +63,7 @@ impl Input {
&self.inv
}

pub fn new_ereports(&self) -> &IdOrdMap<fm::Ereport> {
pub fn new_ereports(&self) -> &IdOrdMap<Arc<fm::Ereport>> {
&self.new_ereports
}

Expand Down Expand Up @@ -151,7 +151,7 @@ pub struct Builder {
in_service_disks: Arc<IdOrdMap<InServiceDisk>>,
/// Ereports which are new and should be input to analysis in the next
/// sitrep.
new_ereports: IdOrdMap<fm::Ereport>,
new_ereports: IdOrdMap<Arc<fm::Ereport>>,

/// The IDs of any ereports which have been included in the parent sitrep,
/// but which have *not* yet been marked as seen in the database.
Expand Down Expand Up @@ -196,7 +196,7 @@ impl Builder {
}
}

Some(ereport)
Some(Arc::new(ereport))
}))
}

Expand Down
6 changes: 3 additions & 3 deletions nexus/fm/src/diagnosis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
//! Each submodule defines one diagnosis engine (DE). `analyze` dispatches to
//! each engine in turn; engines are deterministic and idempotent per RFD 603.

use crate::SitrepBuilder;

mod physical_disk;
mod power_shelf;

pub fn analyze(builder: &mut SitrepBuilder<'_>) -> anyhow::Result<()> {
physical_disk::analyze(builder)?;
power_shelf::analyze(builder)?;
Ok(())
}

Expand All @@ -33,5 +33,5 @@ pub fn analyze(builder: &mut SitrepBuilder<'_>) -> anyhow::Result<()> {
/// (`class LIKE 'ereport.cpu.amd.%'`) or a `known_ereport_class` lookup
/// table joined into the query. Revisit this if the list grows that large.
pub fn known_ereport_classes() -> &'static [&'static str] {
&[]
&[power_shelf::PSU_INSERT_EREPORT, power_shelf::PSU_REMOVE_EREPORT]
}
Loading
Loading