Skip to content

[fm] Rename SitrepGuardedResource to FmRendezvousResource and extract to a shared module#10721

Open
mergeconflict wants to merge 3 commits into
mainfrom
mergeconflict/extract-fm-rendezvous-resource
Open

[fm] Rename SitrepGuardedResource to FmRendezvousResource and extract to a shared module#10721
mergeconflict wants to merge 3 commits into
mainfrom
mergeconflict/extract-fm-rendezvous-resource

Conversation

@mergeconflict

@mergeconflict mergeconflict commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Both the sitrep generation-guarded insert (SitrepGuardedInsert) and the upcoming creation-marker GC sweep need essentially the same abstraction to capture "Diesel schema types I need for my generic query." This currently comprises:

  • The fm_sitrep table's generation column for a given resource (e.g. fm_sitrep::alert_generation for Alert),
  • The marker table's id column for a given resource (e.g. rendezvous_alert_created::alert_id for Alert),
  • A couple annoying Diesel trait bounds.

When we implement GC for the creation markers, this will also include the table for the resource creation request (e.g. fm_alert_request for Alert) and one more annoying Diesel trait bound.

So this PR renames the SitrepGuardedResource trait to the slightly more palatable FmRendezvousResource and extracts it to a new module so both the guarded-insert CTE and the GC sweep can share it. It also extracts the dummy resource used for testing. This is a pure refactor with no behavioral change.

Context: #10248.

Both the generation-guarded insert (`SitrepGuardedInsert`) and the upcoming
creation-marker GC sweep need the same per-resource Diesel schema types: the
sitrep generation column, the marker id column (and, through it, the marker
table). Pull the trait that carries them -- previously `SitrepGuardedResource`,
local to `sitrep_guard` -- into a new `db::fm_rendezvous_resources` module,
rename it to `FmRendezvousResource`, and move the shared `DummyResource` test
fixtures alongside it.

This is a pure refactor with no behavior change; the GC side (the request
table, its trait bound, and the sweep itself) is added in a follow-up.
@mergeconflict mergeconflict requested review from hawkw and smklein July 1, 2026 23:32
@mergeconflict mergeconflict self-assigned this Jul 1, 2026
@mergeconflict mergeconflict added the fault-management Everything related to the fault-management initiative (RFD480 and others) label Jul 1, 2026
@mergeconflict mergeconflict added this to the 21 milestone Jul 1, 2026
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.

1 participant