Open
Conversation
d2bf8fc to
b6ee77e
Compare
hawkw
reviewed
Mar 17, 2026
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. |
Member
There was a problem hiding this comment.
Thanks for writing this down. I kinda wonder if we ought to write up an issue for some of this...
hawkw
reviewed
Mar 17, 2026
cdb8cb5 to
2dbbfa3
Compare
2dbbfa3 to
c463d46
Compare
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.
c463d46 to
b65d715
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Capture a few comments from the conversation between @hawkw and @smklein in #9552 and previous PRs so I don't mess things up later.