Skip to content

Add review context comments#10075

Open
mergeconflict wants to merge 2 commits intomainfrom
mergeconflict/fm-comments
Open

Add review context comments#10075
mergeconflict wants to merge 2 commits intomainfrom
mergeconflict/fm-comments

Conversation

@mergeconflict
Copy link
Contributor

@mergeconflict mergeconflict commented Mar 17, 2026

Capture a few comments from the conversation between @hawkw and @smklein in #9552 and previous PRs so I don't mess things up later.

@mergeconflict mergeconflict requested review from hawkw and smklein March 17, 2026 19:58
@mergeconflict mergeconflict force-pushed the mergeconflict/fm-comments branch from d2bf8fc to b6ee77e Compare March 17, 2026 20:23
Comment on lines +85 to +97
// (not allocating) but insert one at a time? Note that a batched insert
// would need to use `ON CONFLICT DO NOTHING` rather than checking for
// `Conflict` errors from individual inserts, since multiple Nexus
// instances may run this task concurrently.
//
// Currently, these `alert_create` calls have no guard against a stale
// Nexus inserting alerts from an outdated sitrep. This is fine for now
// because alert requests are carried forward into newer sitreps, so a
// stale insert is redundant rather than incorrect. However, if alerts
// are ever hard-deleted (e.g. when a case is closed), a lagging Nexus
// could re-create "zombie" alert records after deletion. At that point,
// the INSERT should be guarded by a CTE that checks the sitrep
// generation matches the current one.
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for writing this down. I kinda wonder if we ought to write up an issue for some of this...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's captured in #9592, yeah?

@mergeconflict mergeconflict force-pushed the mergeconflict/fm-comments branch from cdb8cb5 to 2dbbfa3 Compare March 18, 2026 00:33
@mergeconflict mergeconflict requested a review from hawkw March 18, 2026 00:35
@mergeconflict mergeconflict force-pushed the mergeconflict/fm-comments branch from 2dbbfa3 to c463d46 Compare March 18, 2026 00:40
Move DB model conventions (field ordering, Diesel derives) from
nexus/db-model/src/fm.rs to the nexus-db-model crate-level docs in
lib.rs, with a vmm example showing schema-to-model type mapping.

Move _on_conn/_in_txn naming conventions from the FM datastore module
to nexus/db-queries/src/db/datastore/mod.rs. Fix the framing: connection
sharing is primarily about pool efficiency, not consistency. Keep the
FM-specific correctness detail (concurrent delete detection, #9594)
inline with a pointer to the general docs.
@mergeconflict mergeconflict force-pushed the mergeconflict/fm-comments branch from c463d46 to b65d715 Compare March 18, 2026 01:18
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.

2 participants