Skip to content

Mark KeyViz hot-key Top-K implemented#1030

Merged
bootjp merged 1 commit into
design/promote-keyviz-subrange-sampling-docfrom
design/promote-keyviz-hot-key-topk-doc
Jul 7, 2026
Merged

Mark KeyViz hot-key Top-K implemented#1030
bootjp merged 1 commit into
design/promote-keyviz-subrange-sampling-docfrom
design/promote-keyviz-hot-key-topk-doc

Conversation

@bootjp

@bootjp bootjp commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Author: bootjp

Summary

  • mark the KeyViz hot-key Top-K design as implemented
  • update code comments and roadmap references to the implemented design filename

Dependency

Verification

  • git diff --check
  • commit signature verified with git verify-commit HEAD

@bootjp

bootjp commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 22144ad2-9421-45dd-8d79-4fce7d37333a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates references to the KeyViz hot-key Top-K design document across various design documents, source code comments, and configuration files, changing them from "proposed" to "implemented". The reviewer suggested also updating the reference to the sub-range sampling design document in docs/design/2026_06_11_proposed_hotspot_split_milestone3_automation.md to its "implemented" version for consistency.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

- The `splitRange` it would call is midpoint-only (`midpoint(r.Start, r.End)` appends a `0x00` byte, `distribution/engine.go:541-547`) and mutates the **in-memory** engine routes directly, bypassing the catalog. That violates the repo convention that all catalog mutations go through `SplitRange` so the version bumps and watchers fan out (CLAUDE.md "Route catalog mutations must go through `SplitRange`"). It also contradicts the parent doc §3.1.3 requirement "Choose split keys from observed key distribution (not midpoint-only)."

Meanwhile, a **second**, fully-wired load-observation pipeline already exists: the keyviz sampler (`keyviz/sampler.go`). The coordinator calls `Sampler.Observe` per resolved `(RouteID, key)` on both the write path (`groupMutations → observeMutation`, `kv/sharded_coordinator.go:1844` and `:1795-1800`) and the linearizable/lease read path (`observeRead`, `kv/sharded_coordinator.go:1819-1824`). The sampler keeps per-route read/write op counts and byte counts, windowed at a flush interval (`keyviz/flusher.go:19` `RunFlusher`), with an optional per-route Top-K hot-key sketch (`docs/design/2026_05_28_proposed_keyviz_hot_key_topk.md`) and order-preserving sub-range buckets (`docs/design/2026_05_25_proposed_keyviz_subrange_sampling.md`). It is allocation-free on the hot path and already behind `--keyvizEnabled`.
Meanwhile, a **second**, fully-wired load-observation pipeline already exists: the keyviz sampler (`keyviz/sampler.go`). The coordinator calls `Sampler.Observe` per resolved `(RouteID, key)` on both the write path (`groupMutations → observeMutation`, `kv/sharded_coordinator.go:1844` and `:1795-1800`) and the linearizable/lease read path (`observeRead`, `kv/sharded_coordinator.go:1819-1824`). The sampler keeps per-route read/write op counts and byte counts, windowed at a flush interval (`keyviz/flusher.go:19` `RunFlusher`), with an optional per-route Top-K hot-key sketch (`docs/design/2026_05_28_implemented_keyviz_hot_key_topk.md`) and order-preserving sub-range buckets (`docs/design/2026_05_25_proposed_keyviz_subrange_sampling.md`). It is allocation-free on the hot path and already behind `--keyvizEnabled`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The reference to the sub-range sampling design should be updated to its implemented filename (2026_05_25_implemented_keyviz_subrange_sampling.md) since that design has also been implemented (as noted in the PR description and other updated files).

Suggested change
Meanwhile, a **second**, fully-wired load-observation pipeline already exists: the keyviz sampler (`keyviz/sampler.go`). The coordinator calls `Sampler.Observe` per resolved `(RouteID, key)` on both the write path (`groupMutations observeMutation`, `kv/sharded_coordinator.go:1844` and `:1795-1800`) and the linearizable/lease read path (`observeRead`, `kv/sharded_coordinator.go:1819-1824`). The sampler keeps per-route read/write op counts and byte counts, windowed at a flush interval (`keyviz/flusher.go:19` `RunFlusher`), with an optional per-route Top-K hot-key sketch (`docs/design/2026_05_28_implemented_keyviz_hot_key_topk.md`) and order-preserving sub-range buckets (`docs/design/2026_05_25_proposed_keyviz_subrange_sampling.md`). It is allocation-free on the hot path and already behind `--keyvizEnabled`.
Meanwhile, a second, fully-wired load-observation pipeline already exists: the keyviz sampler (keyviz/sampler.go). The coordinator calls Sampler.Observe per resolved (RouteID, key) on both the write path (groupMutations -> observeMutation, kv/sharded_coordinator.go:1844 and :1795-1800) and the linearizable/lease read path (observeRead, kv/sharded_coordinator.go:1819-1824). The sampler keeps per-route read/write op counts and byte counts, windowed at a flush interval (keyviz/flusher.go:19 RunFlusher), with an optional per-route Top-K hot-key sketch (docs/design/2026_05_28_implemented_keyviz_hot_key_topk.md) and order-preserving sub-range buckets (docs/design/2026_05_25_implemented_keyviz_subrange_sampling.md). It is allocation-free on the hot path and already behind --keyvizEnabled.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 10634665aa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

phase: 2-A++
parent_design: docs/admin_ui_key_visualizer_design.md
related_design: docs/design/2026_05_25_proposed_keyviz_subrange_sampling.md
related_design: docs/design/2026_05_25_implemented_keyviz_subrange_sampling.md

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Restore the subrange link to an existing document

In this commit, the tree still contains only docs/design/2026_05_25_proposed_keyviz_subrange_sampling.md for the subrange design, so this new ...implemented... reference (also repeated in the body link) points at a non-existent file unless the separate dependency is always applied first. That breaks design metadata/navigation and any link checking for this commit as merged on its current parent.

Useful? React with 👍 / 👎.

@bootjp
bootjp changed the base branch from main to design/promote-keyviz-subrange-sampling-doc July 7, 2026 09:01
@bootjp

bootjp commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@bootjp
bootjp force-pushed the design/promote-keyviz-hot-key-topk-doc branch from 401fc4a to a5c74c9 Compare July 7, 2026 09:03
@bootjp

bootjp commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: a5c74c9064

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@bootjp
bootjp marked this pull request as ready for review July 7, 2026 18:34
@bootjp
bootjp merged commit f4e4052 into design/promote-keyviz-subrange-sampling-doc Jul 7, 2026
5 checks passed
@bootjp
bootjp deleted the design/promote-keyviz-hot-key-topk-doc branch July 7, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant