Repository navigation
fix(common-utils): inline the KV rollup value limit again - #3859
inexpressive wants to merge 1 commit into
Conversation
|
@inexpressive is attempting to deploy a commit to the HyperDX Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: dfd8b12 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Hi @inexpressive, thanks for the pull request! Before we review code from a first-time contributor, a maintainer vouches for them, and you're not on our list yet. There's nothing else to file and this PR stays open — a maintainer will look at it, usually within a day or two, and vouch for you right here if it's a genuine attempt at the problem. To make that quick, check the PR description has:
More detail in our contributing guide. |
PR Review✅ No issues found. |
Deep Review✅ No critical issues found. The production change is a single line: the KV rollup 🟡 P2 -- recommended
🔵 P3 nitpicks (1)
Reviewers (6): correctness, testing, maintainability, project-standards, security, kieran-typescript. Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
Summary
Filter values from the KV rollup MVs fail when the rollup table is
Distributed:#2474 fixed this for #2163 by inlining the limit as a literal. #2643 rewrote
getMetadataMVKeyValuesand brought the boundInt32parameter back. This restores the literal and adds a test that fails onmain.The ClickHouse side is ClickHouse/ClickHouse#71887: a signed parameter of a parametric aggregate (
_CAST(20, 'Int32')) breaks the type conversion on the remote. Unsigned types and literals work. Reproduced on 25.8.33 and 26.8.51; 24.3.18 is not affected.packages/api/src/mcp/tools/sources/describeMetric.tshas the same pattern (groupUniqArray(${{ Int32: MAX_ATTR_VALUES }})). Left out to keep this PR to one code path; happy to add it here or in a follow-up.Screenshots or video
Traces source on a 2-shard × 2-replica cluster, rollup table
Distributed. Taken on 2.46.0 with the same change applied to the built bundle.How to reproduce
Starting point: own setup. play.hyperdx.io and local mode use a single node, so they don't show it.
Minimal repro on any cluster with 2+ shards (HTTP interface,
param_limit=20):Full setup: ClickHouse 25.8, 2 shards; the seed schema from
docker/otel-collector/schema/seedwith each table asReplicated*<name>_localplus aDistributedtable under the original name; trace source withmetadataMaterializedViews.kvRollupTable = otel_traces_kv_rollup_15m.On
main:clickhouse-proxyrequest for the rollup returns 500 with code 70.On this branch:
How to test on Vercel preview
N/A — the demo server is a single node.
References
Note
Low Risk
Small, targeted SQL generation change with validation via
inlineNonNegativeIntand a regression test; restores prior known-good behavior for Distributed rollup reads.Overview
Restores literal
maxValuesPerKeyin the KV rollup MV query (groupUniqArray(7)(Value)instead of a bound{limit:Int32}), matching the pattern already used elsewhere in metadata viainlineNonNegativeInt.This fixes Search filter values missing (500 / ClickHouse code 70) when
kvRollupTableis a Distributed table over multiple shards—a regression from reintroducing theInt32parameter after #2474.A unit test asserts the MV path emits
groupUniqArray(N)(Value)in SQL and does not use a parameterized aggregate argument.Reviewed by Cursor Bugbot for commit dfd8b12. Bugbot is set up for automated code reviews on this repo. Configure here.