Commit 57769f6
authored
[fm] GC sweep for FM creation-marker tables (#10762)
The "creation marker" tables, `rendezvous_alert_created` and
`rendezvous_support_bundle_created`, contain a row for each alert and
support bundle created by FM respectively, written by
`SitrepGuardedInsert`. These prevent FM rendezvous from resurrecting a
resource the user has deleted, so it must live for as long as some
sitrep that requests the resource might still be executed. Once no
current or future sitrep can request the resource, its marker is safe to
delete. This PR adds garbage collection for these creation marker
tables.
This comprises:
- A generic page query (`RendezvousMarkerGcPage`), parameterized by
`FmRendezvousResource` (see PR #10721), that emits the same two-CTE SQL
for both tables, varying only the marker table, resource-id column, and
request table.
- Datastore wrappers driving the sweep for both resources.
- Wiring into the `fm_rendezvous` background task, with stats surfaced
through the internal API and omdb.
- Datastore tests against the dummy resource (deletion predicate, cursor
advance, expectorated SQL), plus GC assertions in the existing
background-task tests covering both real resources.
Fixes #10248.1 parent fbb1c1d commit 57769f6
9 files changed
Lines changed: 899 additions & 63 deletions
File tree
- dev-tools/omdb
- src/bin/omdb
- tests
- nexus
- db-queries
- src/db
- datastore
- tests/output
- src/app/background/tasks
- types/src/internal_api
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3759 | 3759 | | |
3760 | 3760 | | |
3761 | 3761 | | |
| 3762 | + | |
| 3763 | + | |
3762 | 3764 | | |
3763 | 3765 | | |
3764 | 3766 | | |
| |||
3936 | 3938 | | |
3937 | 3939 | | |
3938 | 3940 | | |
| 3941 | + | |
| 3942 | + | |
| 3943 | + | |
| 3944 | + | |
| 3945 | + | |
| 3946 | + | |
| 3947 | + | |
| 3948 | + | |
| 3949 | + | |
| 3950 | + | |
| 3951 | + | |
| 3952 | + | |
| 3953 | + | |
| 3954 | + | |
| 3955 | + | |
| 3956 | + | |
| 3957 | + | |
| 3958 | + | |
| 3959 | + | |
| 3960 | + | |
| 3961 | + | |
| 3962 | + | |
| 3963 | + | |
| 3964 | + | |
| 3965 | + | |
| 3966 | + | |
| 3967 | + | |
| 3968 | + | |
| 3969 | + | |
| 3970 | + | |
3939 | 3971 | | |
3940 | 3972 | | |
3941 | 3973 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
750 | 750 | | |
751 | 751 | | |
752 | 752 | | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
753 | 763 | | |
754 | 764 | | |
755 | 765 | | |
| |||
1450 | 1460 | | |
1451 | 1461 | | |
1452 | 1462 | | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
1453 | 1473 | | |
1454 | 1474 | | |
1455 | 1475 | | |
| |||
0 commit comments