Commit 7a5f735
authored
[multicast] implicit group lifecycle with IP pool integration (#9450)
This PR also addresses permission models, object deletion, and error handling questions related to reserved addresses presented in @askfongjojo's testing Google Doc (default IP Pools are covered in mainline already).
In thinking through the *Groups* API, permission scopes, and flexibility, @rcgoodfellow mentioned this consideration:
> Do we need an explicit notion of a group object at all? Or can instances simply allocate/deallocate group IPs from pools, and there is no explicit management of group objects.
With Fleet admins having access control to create pools and link silos to a pool, we arrived at the idea of replacing the current explicit multicast group CRUD with an implicit lifecycle, where groups are created upon the first member join and deleted when the last member leaves.
**Auth Model:**
- Discovery (fleet-scoped):
- Read/list groups and list members: any authenticated user in the same fleet.
- Membership (project-scoped):
- Join/leave requires Instance::Modify on the specific instance.
- Creation control:
- Implicit group creation only when the caller's silo is linked to a suitable multicast pool (by name or by explicit IP in that pool).
**Behavior:**
- Implicit lifecycle:
- Create on first join (idempotent); delete when last member leaves (atomic mark-for-removal, reconciler schedules cleanup).
- Addressing and validation:
- Implicit allocation from the caller's linked multicast pools.
- SSM/ASM semantics enforced:
- IPv4 SSM 232/8 and IPv6 ff3x::/32 require ≥1 source IP.
- ASM groups may optionally specify sources (can be `None`).
- When joining by explicit IP: resolve the pool containing the IP, verify the silo link before creating.
- Error handling:
- Reserved/invalid multicast ranges rejected at pool/range add time.
**API:**
- Primary flows:
- Group-centric member management: POST/DELETE /v1/multicast-groups/{group}/members
- Instance-centric join/leave: PUT/DELETE /v1/instances/{instance}/multicast-groups/{group}
- Discovery endpoints remain for list/view; there is no explicit group create/update/delete.
- This is a *breaking* change, but multicast is not yet enabled or available in production.
**Key changes:**
- Implicit group model; groups exist while they have members.
- IP pool integration for multicast allocation with silo link gating.
- Simplified API centered on join/leave flows.
- Add multicast_ip to the member table for responses.
- For consistency, move to `Instant` type over `SystemTime` for mcast-related caches.
This also fixes the flaky test issue in #9588.1 parent 63d8904 commit 7a5f735
File tree
83 files changed
+45284
-8924
lines changed- common/src
- api/external
- dev-tools/omdb/tests
- illumos-utils/src/opte
- nexus-config/src
- nexus
- auth/src/authz
- db-model/src
- db-queries
- src/db
- datastore
- multicast
- ops
- pub_test_utils
- queries
- tests/output
- db-schema/src
- external-api
- output
- src
- src
- app
- background
- tasks
- multicast
- multicast
- sagas
- external_api
- test-utils/src
- tests/integration_tests
- multicast
- types/src
- external_api
- internal_api
- openapi/nexus
- schema/crdb
- multicast-implicit-lifecycle
- workspace-hack
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
83 files changed
+45284
-8924
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
632 | | - | |
| 632 | + | |
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
30 | 29 | | |
31 | | - | |
| 30 | + | |
32 | 31 | | |
33 | | - | |
34 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
35 | 36 | | |
36 | | - | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
| 46 | + | |
46 | 47 | | |
47 | | - | |
| 48 | + | |
48 | 49 | | |
49 | | - | |
| 50 | + | |
50 | 51 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
55 | 78 | | |
56 | 79 | | |
57 | | - | |
58 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
59 | 84 | | |
60 | 85 | | |
61 | 86 | | |
62 | 87 | | |
| 88 | + | |
63 | 89 | | |
64 | 90 | | |
65 | 91 | | |
66 | | - | |
67 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
68 | 98 | | |
69 | 99 | | |
70 | 100 | | |
71 | 101 | | |
72 | | - | |
73 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
74 | 106 | | |
75 | 107 | | |
76 | 108 | | |
77 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
78 | 114 | | |
79 | 115 | | |
80 | | - | |
| 116 | + | |
81 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
82 | 124 | | |
83 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
84 | 161 | | |
| 162 | + | |
85 | 163 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
93 | 175 | | |
94 | 176 | | |
| 177 | + | |
95 | 178 | | |
96 | 179 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
104 | 208 | | |
105 | 209 | | |
106 | 210 | | |
| |||
254 | 358 | | |
255 | 359 | | |
256 | 360 | | |
257 | | - | |
258 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
259 | 364 | | |
260 | 365 | | |
261 | 366 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2558 | 2558 | | |
2559 | 2559 | | |
2560 | 2560 | | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
2561 | 2566 | | |
2562 | 2567 | | |
2563 | 2568 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
713 | 713 | | |
714 | 714 | | |
715 | 715 | | |
716 | | - | |
| 716 | + | |
717 | 717 | | |
718 | 718 | | |
719 | 719 | | |
| |||
1281 | 1281 | | |
1282 | 1282 | | |
1283 | 1283 | | |
1284 | | - | |
| 1284 | + | |
1285 | 1285 | | |
1286 | 1286 | | |
1287 | 1287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
752 | 753 | | |
753 | 754 | | |
754 | 755 | | |
755 | | - | |
| 756 | + | |
756 | 757 | | |
757 | 758 | | |
758 | 759 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | | - | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
| |||
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
34 | | - | |
35 | 32 | | |
36 | 33 | | |
37 | 34 | | |
| |||
944 | 941 | | |
945 | 942 | | |
946 | 943 | | |
947 | | - | |
948 | | - | |
949 | | - | |
950 | | - | |
951 | | - | |
952 | | - | |
953 | | - | |
954 | | - | |
955 | | - | |
956 | 944 | | |
957 | 945 | | |
958 | 946 | | |
| |||
0 commit comments