Use collision-free interned group keys in DAG execution - #585
Merged
Merged
Conversation
zzylol
force-pushed
the
perf/canonical-group-key
branch
from
September 10, 2026 17:45
151ea66 to
a6eb235
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prometheus and OTLP ingress previously flattened GROUP BY values with
;. Distinct groups such as(x="a;b", y="c")and(x="a", y="b;c")therefore shared worker state, and downstream code had to reconstruct labels by splitting an ambiguous string.This change introduces one typed
GroupKeyfor router-to-worker execution. Its versioned, length-prefixed encoding preserves label names, values, and projection order. A bounded interner lets shared DAG consumers reuse the same immutable key and avoids rebuilding name/value allocations for repeated series. Remote-write series population keys now use the same representation, while persisted series IDs and SketchDB keys remain unchanged and require no migration.The worker emits label values and population labels directly from the typed key. Tests cover delimiter collisions, different label names, projection order, missing values, interner reuse, and ingress routing. A Criterion case measures 100,000 high-cardinality, delimiter-rich two-label projections.
Validation:
cargo test -p data_plane --no-runcargo test -p data_plane group_key --lib(4 passed)cargo bench -p data_plane --bench sketch_db -- group_key_projection --sample-size 10 --measurement-time 1 --warm-up-time 1AddrInUse).