feat: compute deterministic timeseries_id column at ingest#6286
Open
g-talbot wants to merge 4 commits intogtt/parquet-column-ordering-v2from
Open
feat: compute deterministic timeseries_id column at ingest#6286g-talbot wants to merge 4 commits intogtt/parquet-column-ordering-v2from
g-talbot wants to merge 4 commits intogtt/parquet-column-ordering-v2from
Conversation
1fba6db to
9ac8674
Compare
Base automatically changed from
gtt/parquet-column-ordering
to
gtt/docs-claude-md
April 10, 2026 10:57
9ac8674 to
60d859c
Compare
60d859c to
9522326
Compare
9e5c6ef to
cc4492e
Compare
Add a timeseries_id column (Int64) to the metrics Arrow batch, computed as a SipHash-2-4 of the series identity columns (metric_name, metric_type, and all tags excluding temporal/value columns). The hash uses fixed keys for cross-process determinism. The column is already declared in the metrics default sort schema (between host and timestamp_secs), so the parquet writer now automatically sorts by it and places it in the correct physical position. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The timeseries_id hash is persisted to Parquet files — any change
silently corrupts compaction and queries. Add:
- 3 pinned stability tests with hardcoded expected hash values
- 3 proptest properties (order independence, excluded tag immunity,
extra-tag discrimination) each running 256 random cases
- Boundary ambiguity test ({"ab":"c"} vs {"a":"bc"})
- Same-series-different-timestamp invariant test
- All-excluded-tags coverage (every EXCLUDED_TAGS entry verified)
- Edge cases: empty strings, unicode, 100-tag cardinality
- Module-level doc explaining the stability contract
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mirror the CTE + FOR UPDATE pattern from delete_splits to prevent stale-state races. Without row locking, a concurrent mark_metrics_splits_for_deletion can commit between the state read and the DELETE, causing spurious FailedPrecondition errors and retry churn. The new query locks the target rows before reading their state, reports not-deletable (Staged/Published) and not-found splits separately, and only deletes when all requested splits are in MarkedForDeletion state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cc4492e to
946c229
Compare
9522326 to
b0344ba
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.
Summary
timeseries_idcolumn (Int64) to the metrics Arrow batch, computed as a deterministic SipHash-2-4 of the series identity columnsmetric_name,metric_type, and all tags — excludes temporal columns (timestamp_secs,start_timestamp_secs,timestamp) and value columns (value, plus DDSketch components from [metrics] Support DDSketch in the parquet pipeline #6257:count,sum,min,max,flags,keys,counts)metric_name|service|env|datacenter|region|host|timeseries_id|timestamp_secs/V2), so the writer automatically sorts by it and places it in the correct physical positionTimeseriesIdvariant toParquetFieldenum and updatesSORT_ORDERDesign reference
Sorted Series Column for QW Parquet Pipeline — this PR implements the Timeseries ID component; the full Sorted Series composite key is a follow-up.
Test plan
compute_timeseries_id(determinism, exclusions, order independence, key/value non-interchangeability)quickwit-parquet-engineandquickwit-opentelemetrypass with updated column countsreorder_columnsnot introduced by this PR)🤖 Generated with Claude Code