Repository navigation
feat(data_plane): read view label columns back from the series identity - #869
Merged
zzylol merged 3 commits intoNov 24, 2026
Merged
Conversation
A view's text column whose every row holds its series identity's label of the column's name is no longer stored: the fragment marks it IDENTITY_LABEL and a read rebuilds it from the identity column's keys and a per-segment label array. View file format version 3; older segments are set aside at startup.
…ollow-ups Label values per segment are extended by the texts added since (parsed uncached), counted with the segment's dictionaries; descriptor bounds are checked once; empty windows store no identity labels; tests cover identities that are not interned, the startup index and the extension.
… when writing The writer looked up every row's identity in the process-wide interner for every fragment (about 600k lock acquisitions per second in the demo); the active segment now caches each identity's labels.
zzylol
marked this pull request as ready for review
November 24, 2026 15:04
This was referenced Nov 24, 2026
zzylol
added a commit
that referenced
this pull request
Nov 24, 2026
…, label columns, RFC 3339 times, format 4 (#871) Ports #865, #869, #868 and #866 from the tiered-view-storage branch to main: a read-back view window is charged its own bytes; label text columns are rebuilt from the series identity; query times are read as Unix seconds or RFC 3339; view fragments are compact and zstd-compressed (view file format 4; formats 2 and 3 are set aside at startup). Tests adapted to main's APIs.
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.
Summary
Problem: per-series views store each label (
job,region,service, …) as a text column: a 4-byte key per row per label. Those keys repeat what the row's series identity already encodes.Change: a text column whose every row equals the row's series-identity label of that name (
""when absent) is no longer written. The fragment marks itIDENTITY_LABEL, and a read rebuilds it from the identity column's keys through a per-segment label-value array. The view file format becomes version 3; older segments are set aside at startup.Effect: 12-minute replay of the live demo's plan and load, minutes 6–12, against this branch with fix(data_plane): charge a read-back view window its own bytes, not the segment dictionary #865 merged:
Query latency was slightly higher in this one run (p50 0.78 → 0.83 s; requests over SLO 101 → 215 of about 9,500), with equal ingest throughput and decode CPU. See the caveat under Verification.
Query answers are unchanged: the cold-read parity suites pass. The executor's output schema is unchanged, so no ASAPPlanner change is needed.
Review guide
feat/tiered-view-storage, the demo branch, with fix(data_plane): charge a read-back view window its own bytes, not the segment dictionary #865 merged.data_plane/src/segment.rs:IdentityLabels::of/holds_label: the writer's check;IDENTITY_LABELarm ofdecode_fragment;Segment::label_values.label_valuesextends the cached array incrementally as the active segment's texts grow;Segment::dictionary_bytesthroughdictionaries_built.descriptor()/Descriptorfactor out the existing descriptor parsing; the design doc is updated.Behavior: before → after
View 122 of the demo plan:
sum by (region, service, job) (sum_over_time(data[3m])), exact Sum per series at 1 s over 10,000 series. Its schema iswindow_end, state, job, region, service, $promql_series_identity.Replay, minutes 6–12. Both runs used the same 40-core host, back to back:
The analysis estimated about 15% of view bytes (2.9 GB/h) for label keys. The measured saving is 2.0 GB/h, because some views carry no label columns or no identity column.
Interfaces
data_plane/src/segment.rs,data_plane/src/series_ids.rsFile format: fragment column kind 8 (
IDENTITY_LABEL). The header version is 3. A version 2 segment is renamed.staleat startup with the warninga segment of another plan, group or format version (this data plane reads version 3); no migration is done.Usage: the data plane runs as before (
data_plane --plan plan.json --view-dir views).encode_fragmentfinds$promql_series_identityin the schema and looks up each row's labels in the interner (labels_of_identity). It writesjob/region/serviceasIDENTITY_LABEL.Segment::label_values("job", ..).Algorithm changes
Label columns on disk.
IDENTITY_LABELwhen every row's value equalslabels(identity)[name](""when absent). The identity column is itself text with no nulls, and the window is not empty. Otherwise it is stored as before.label_columns_are_read_back_from_the_series_identity(active, sealed in both read modes, after restart through the index, after the active segment's texts grow, interned and never-interned identities, a non-derivable column stored as text), andan_older_format_version_segment_is_set_aside.with_every_view_read_cold_*inplanner_executor_parity.Decisions and open questions
Verification
cargo test -p data_plane --lib(persist, segment, store, window_cache, series_ids)view_cache_charge,view_tiering,view_persistence,view_cold_allocationsplanner_executor_paritycold suites (instant, range)planner_executor_paritypush suitescargo fmt --check,cargo clippy -p data_plane --all-targets -D warningsFollow-ups
Re-targeting:
feat/tiered-view-storagehas landed on main (feat(data_plane): tiered view storage, push precompute by default, faster Remote Write decode #864). This change should be re-targeted to main afterwards, as a cherry-pick of the squash commit.data-plane: compact, compressed view fragments (format 4) #866 also claims format version 3. Whichever of data-plane: compact, compressed view fragments (format 4) #866 and this PR merges second must bump to version 4.
From the analysis, not in this PR: memory-only short-retention views, segment length sized by retention, and sharing identical views in the planner.