Commit b2fab54
authored
Add intra-namespace percentage rollout for CHASM Nexus operation creation (#10950)
## What changed?
Adds a per-namespace **percentage** control for routing new
workflow-triggered Nexus operations to the CHASM implementation, on top
of the existing boolean `nexusoperation.enableChasmWorkflowOperations`
flag.
- New dynamic config
`nexusoperation.chasmWorkflowOperationsRolloutPercent` (int, 0–100),
**default 0**.
- The HSM→CHASM creation decision is centralized in one predicate,
`nexusoperation.UseChasmForWorkflow(enabled, rolloutPercent,
namespaceName, workflowID)`: an operation is created on the CHASM tree
only when the boolean flag is on **AND** the workflow falls within the
rollout percentage. Membership is decided by the shared `RolloutAccepts`
helper hashing `namespace + workflowID` (same key shape as the Scheduler
CHASM rollout), so a given workflow deterministically lands on the same
implementation across all of its operations and dialing the percentage
up is monotonic.
- **Both** framework-decision sites use the same predicate:
- **Live creation** — the CHASM `ScheduleNexusOperation` command handler
(`handleScheduleCommand`). Out-of-rollout → `ErrCommandNotSupported`, so
the operation is created on the HSM tree as before.
- **Reset / replication rebuild** —
`MutableStateRebuilder.applyChasmEvent`, on the
`NexusOperationScheduled` create event. Sharing the exact predicate is
required: otherwise a reset could flip an out-of-rollout workflow's
operations onto CHASM.
- **Cancelation is intentionally not gated** by this predicate. It is
routed by the tree that already owns the operation, so an operation
created while the flag/percentage was higher can still be canceled after
a downgrade.
## Why?
The per-namespace boolean is too coarse for a safe migration: turning it
on sends *all* of a namespace's new Nexus operations to CHASM at once. A
percentage control lets us dial CHASM adoption up gradually *within* a
namespace and roll back by dialing down — the de-risking control our
rollout plan requires. The default of 0 makes the boolean alone a no-op
until the percentage is explicitly raised, so enabling the flag can't
cause an all-at-once cutover.
## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [x] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)
## Potential risks
Low, and gated behind the default. Default 0 means behavior is unchanged
for any namespace that hasn't set the percentage — enabling the boolean
alone now routes nothing to CHASM until the percentage is raised. The
one behavioral consequence: any test/config that enables the boolean
expecting CHASM must also set the percentage (done for the tests in the
repo); no production config force-enables the boolean today.1 parent dc5b517 commit b2fab54
8 files changed
Lines changed: 202 additions & 88 deletions
File tree
- chasm/lib
- nexusoperation
- workflow
- service/history
- configs
- workflow
- tests
- xdc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
45 | 68 | | |
46 | 69 | | |
47 | 70 | | |
| |||
218 | 241 | | |
219 | 242 | | |
220 | 243 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
248 | 272 | | |
249 | 273 | | |
250 | 274 | | |
251 | 275 | | |
252 | 276 | | |
253 | 277 | | |
254 | 278 | | |
| 279 | + | |
255 | 280 | | |
256 | 281 | | |
257 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
| |||
113 | 118 | | |
114 | 119 | | |
115 | 120 | | |
| 121 | + | |
116 | 122 | | |
117 | 123 | | |
118 | 124 | | |
| |||
143 | 149 | | |
144 | 150 | | |
145 | 151 | | |
146 | | - | |
| 152 | + | |
| 153 | + | |
147 | 154 | | |
148 | 155 | | |
149 | 156 | | |
150 | 157 | | |
151 | 158 | | |
152 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 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 | + | |
| 208 | + | |
153 | 209 | | |
154 | 210 | | |
155 | 211 | | |
| |||
0 commit comments