[fm] Rename SitrepGuardedResource to FmRendezvousResource and extract to a shared module#10721
Open
mergeconflict wants to merge 3 commits into
Open
[fm] Rename SitrepGuardedResource to FmRendezvousResource and extract to a shared module#10721mergeconflict wants to merge 3 commits into
SitrepGuardedResource to FmRendezvousResource and extract to a shared module#10721mergeconflict wants to merge 3 commits into
Conversation
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.
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.
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:fm_sitreptable's generation column for a given resource (e.g.fm_sitrep::alert_generationforAlert),rendezvous_alert_created::alert_idforAlert),When we implement GC for the creation markers, this will also include the table for the resource creation request (e.g.
fm_alert_requestforAlert) and one more annoying Diesel trait bound.So this PR renames the
SitrepGuardedResourcetrait to the slightly more palatableFmRendezvousResourceand 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.