-
Notifications
You must be signed in to change notification settings - Fork 2
docs: propose KeyViz adapter / namespace labels (follow-up) #694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
a6270d3
3c14f29
ce8f95b
ae43bfe
2750f4c
9e1dcf1
3ae3417
3793366
e9769e1
ab0162c
38e25bf
8d6d290
5b83bd1
bda27ca
71a24f4
5a14dd6
545b1a1
1c18d2e
f6c4dd7
de7dad5
292918d
88742d4
14f7b98
6ee4146
cee5460
0e4db28
7b99d65
c763753
e5c7e39
795c504
09c1c04
788b685
e7b0c13
44d7cd4
c788a96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,269 @@ | ||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||
| status: proposed | ||||||||||||||||||||||||||||||||||||||||||||
| phase: keyviz / follow-up | ||||||||||||||||||||||||||||||||||||||||||||
| parent_design: docs/admin_ui_key_visualizer_design.md | ||||||||||||||||||||||||||||||||||||||||||||
| date: 2026-04-28 | ||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| # KeyViz adapter / namespace labels | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
| Status: proposed | |
| Author: TBD | |
| Date: 2026-04-28 |
Copilot
AI
Apr 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doc uses a YAML front-matter block (lines 1–7), but docs/design/README.md specifies the standard design-doc metadata as a header under the title (Status/Author/Date, see README.md:40–53). To stay consistent with the documented convention, please convert this metadata to the standard header format (or update the README if YAML front-matter is now the intended standard).
| --- | |
| status: proposed | |
| phase: 2-C+ | |
| parent_design: docs/admin_ui_key_visualizer_design.md | |
| author: bootjp | |
| date: 2026-04-28 | |
| --- | |
| # KeyViz adapter / namespace labels | |
| # KeyViz adapter / namespace labels | |
| Status: proposed | |
| Phase: 2-C+ | |
| Parent design: `docs/admin_ui_key_visualizer_design.md` | |
| Author: bootjp | |
| Date: 2026-04-28 |
Copilot
AI
Apr 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
§2.1 claims "Zero hot-path penalty when labels are not configured", but §4.1 later notes the slots map key widens from uint64 to {uint64, Label}, which adds extra hash/equality work even when callers always pass the empty label. Consider rewording the goal to match the actual expected impact (e.g., "no additional lookups/allocations" / "minimal penalty"), or explicitly proposing a dual representation so the legacy unlabeled path keeps a map[uint64]*routeSlot fast path when labels are disabled.
| - Zero hot-path penalty when labels are **not** configured: a | |
| default deployment continues to behave exactly as today. | |
| - Minimal hot-path penalty when labels are **not** configured: a | |
| default deployment preserves current semantics and should incur | |
| no additional lookups or allocations, with only minimal extra | |
| hash/equality work if the implementation widens the in-memory | |
| slot key to include the label. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proposal states that Observe will use a map keyed by (routeID, label) and that RegisterRoute will be a "no-op" for labels. However, Observe is designed to be a lockless hot-path operation that relies on a pre-populated routeTable. If RegisterRoute does not pre-register the (routeID, label) combinations, Observe will fail to find a slot. If Observe were to create slots dynamically, it would require a mutex or a copy-on-write operation, violating the "zero hot-path penalty" goal. Please clarify how labeled slots are populated into the routeTable while maintaining a lockless Observe path.
Copilot
AI
Apr 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc says the hot path cost is "one extra map lookup per Observe" when switching from tbl.slots[routeID] to tbl.slots[slotKey{routeID,label}], but the current implementation already does a single slots lookup (with an occasional fallback lookup into virtualForRoute on miss). Consider rewording to reflect the real change: wider key hashing/comparison cost (and possibly a higher miss rate if labels aren't pre-created), rather than an additional lookup on the hit path.
| Cost on hot path: one extra map lookup per Observe — slot is now | |
| keyed by `(routeID, label)` instead of just `routeID`. The map | |
| key is a struct of `{uint64, string}`; the `label` is a small | |
| interned constant (`"dynamo"`), so allocation should be zero. | |
| Cost on hot path: still one `slots` map lookup per `Observe` on | |
| the hit path, but keyed by `(routeID, label)` instead of just | |
| `routeID`. That means somewhat wider key hashing/comparison for a | |
| `{uint64, string}` map key, and potentially a higher miss rate if | |
| labeled slots are not pre-created. The `label` is a small interned | |
| constant (`"dynamo"`), so allocation should be zero. |
Copilot
AI
Apr 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This recommendation sentence reintroduces the earlier corrected wording: calling the change a "hot-path delta (one map lookup)" can be read as adding an extra lookup, but §4.1 states lookup count is unchanged and only the key shape widens. Consider rephrasing to explicitly say the hot path remains a single lookup (with wider key) to avoid confusion.
| **Recommendation: Option 4.1.** Lowest plumbing weight, smallest | |
| hot-path delta (one map lookup), and the label originates where | |
| it is most naturally available (the adapter's dispatch entry). | |
| The `routeSlot` map shape changes from `map[uint64]*routeSlot` to | |
| `map[slotKey]*routeSlot` with `slotKey = {uint64, string}`. | |
| **Recommendation: Option 4.1.** Lowest plumbing weight, and the | |
| label originates where it is most naturally available (the | |
| adapter's dispatch entry). The hot path remains a single map | |
| lookup; only the lookup key widens. The `routeSlot` map shape | |
| changes from `map[uint64]*routeSlot` to `map[slotKey]*routeSlot` | |
| with `slotKey = {uint64, string}`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The design suggests that bucket_id formatting stays as-is (e.g., route:1) and the label is a separate field. This creates a problem for the GetRouteDetail(bucket_id) RPC and the SPA's row identification, as bucket_id is no longer unique per heatmap row. This change presents a significant operational risk for rolling upgrades and system migration. Per repository guidelines, please detail potential mitigation strategies (e.g., a temporary 'bridge' or 'proxy' mode) and strategies for zero-downtime cutovers to avoid service interruption.
References
- When a design document identifies a significant operational risk, such as the inability to perform rolling upgrades, it must also detail potential mitigation strategies, like implementing a temporary 'bridge' or 'proxy' mode.
- When designing a production-grade system migration, the plan must consider and detail strategies for live or zero-downtime cutovers to avoid service interruption.
Copilot
AI
Apr 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Performance lens says "One extra map lookup per Observe" here, but §4.1 explicitly notes the lookup count is unchanged and only the key widens. These two statements contradict; please make them consistent (e.g., describe the cost as a wider hash/equality on the same single lookup, not an additional lookup).
| 3. **Performance** — One extra map lookup per Observe via the | |
| wider key. `BenchmarkObserveParallel` already pins the hot-path | |
| 3. **Performance** — The hot path still does one map lookup per | |
| Observe; the only extra work is hashing/equality on the wider | |
| key. `BenchmarkObserveParallel` already pins the hot-path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Front-matter
phasevalues in other KeyViz design docs are short, machine-friendly tokens like2-B/2-C(see docs/design/2026_04_27_proposed_keyviz_spa_integration.md:1-6 and 2026_04_27_proposed_keyviz_cluster_fanout.md:1-6).phase: keyviz / follow-upis the only variant with spaces and/, which may be harder to grep/sort consistently; consider aligning it to the existing phase scheme (e.g.2-C+or similar).