Commit 5fb30b4
Preserve client overrides in Luna comparison
Summary:
Pass explicit client-owned option names to `McrouterOptionsBase::compare()` so Luna comparison skips only `config_params` and `router_name` overrides while preserving missing-key validation for every Luna-managed option. Apply both overrides as typed fields after Luna materialization, avoiding delimiter-based serialization.
Review context
This child responds to the following comment from Anton (`alikhtarov`) on D113813215:
> Can we reorder the logic here to avoid hasConfigParamsOverride? I.e.
>
> 1) construct lunaOptions (copy config_params from before)
> 2) apply luna settings
> 3) compare lunaOptions with currentOptions (need to rewrite the comparison function)
>
> This is probably more correct as well as we're comparing actual options struct instead of serialized representations.
What this addresses:
- Removes the `hasConfigParamsOverride` flag and post-comparison `remove_if`; client-owned options are represented explicitly.
- Keeps overridden `config_params` and `router_name` out of raw Luna comparison and overlays them as typed fields after Luna application.
- Retains existing missing-key errors for every non-overridden Luna-managed option.
What this does not address:
- It does not reorder the entire pipeline to apply Luna before comparison.
- It does not compare two `McrouterOptions` structs; non-overridden options still use the existing raw Luna-map comparison.
This narrower scope avoids introducing generic typed-comparison infrastructure and changing scalar normalization semantics while addressing the override-handling concern that motivated the comment.
Reviewed By: alikhtarov
Differential Revision: D114116126
fbshipit-source-id: 1e0ed10bfe3fa990fb8881e2a44e6c7d2d7b4f9b1 parent ccfd256 commit 5fb30b4
2 files changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
| 273 | + | |
| 274 | + | |
274 | 275 | | |
275 | | - | |
| 276 | + | |
276 | 277 | | |
277 | 278 | | |
278 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
279 | 283 | | |
280 | 284 | | |
281 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
0 commit comments