Fix Phase 0.5 trace writer correctness#303
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## olap-serving-layer #303 +/- ##
=====================================================
Coverage ? 76.57%
=====================================================
Files ? 26
Lines ? 918
Branches ? 0
=====================================================
Hits ? 703
Misses ? 215
Partials ? 0 🚀 New features to boost your workflow:
|
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.
Pull Request
Short Summary
Fixes the Phase 0.5 trace storage correctness issues that block bounded trace lookup. Replaces trace-id-only span caching with a query-shape cache key, centralizes Parquet writer properties, adds vacuum retention safeguards, and partitions eval scenarios by UTC created date.
Context
The old trace span cache keyed only on
trace_id, which is unsafe once callers add time bounds, service filters, limits, or payload selection. This PR makes the cache key match the query shape and bypasses the cache when a query cannot be represented safely.Before:
After:
The writer-property changes pull the repeated Parquet configuration into
writer_props.rs. Trace spans, summaries, GenAI spans, dispatch records, Bifrost datasets, eval scenarios, and the control table now use explicit writer-property profiles instead of each engine carrying its own partial copy. Summary optimize also reapplies its writer properties during compaction, which was the known bug in the Phase 0.5 plan.Vacuum calls now use
SCOUTER_TRACE_VACUUM_RETENTION_HOURSwith a default of 24 hours.retention_hours=0is rejected unlessSCOUTER_TRACE_UNSAFE_VACUUM_ALLOW_ZERO=true.Eval scenarios now include a non-null
partition_datecolumn derived fromcreated_atin UTC and create Delta partitions underpartition_date=YYYY-MM-DD.crates/scouter_dataframe/src/parquet/writer_props.rscrates/scouter_dataframe/src/parquet/maintenance.rscrates/scouter_dataframe/src/parquet/mod.rscrates/scouter_dataframe/src/parquet/tracing/queries.rsSpanCacheKey, cache policy, weight estimation, and key-isolation tests.crates/scouter_dataframe/src/parquet/tracing/engine.rscrates/scouter_dataframe/src/parquet/tracing/summary.rscrates/scouter_dataframe/src/parquet/tracing/genai.rscrates/scouter_dataframe/src/parquet/tracing/dispatch.rscrates/scouter_dataframe/src/parquet/tracing/service.rscrates/scouter_dataframe/src/parquet/bifrost/engine.rscrates/scouter_dataframe/src/parquet/control/engine.rscrates/scouter_dataframe/src/parquet/eval_scenarios/engine.rspartition_date, partitioned table creation/writes, schema evolution for existing local tables, and shared writer properties.crates/scouter_dataframe/tests/eval_scenarios.rscreated_atdate.crates/scouter_settings/src/storage.rsIs this a Breaking Change?
Yes.
eval_scenariosgains a new physical Delta column and partition layout before the table is released, and trace cache behavior changes to include query shape in the key; existing public Rust/Python APIs are unchanged.