refactor(query-engine): split engine and storage naming - #137
Merged
Merged
Conversation
zzylol
force-pushed
the
refactor/query-engine-storage-naming
branch
2 times, most recently
from
May 11, 2026 23:27
7133929 to
126c0a7
Compare
After splitting StorageBackend enum names (SketchStore /
GorillaObjectStore), several routing tests still referenced the
pre-rename engine-id strings ('asap_query' / 'thanos_query') where
they should use the snake-case serde tags ('sketch_store' /
'gorilla_object_store') — YAML parses through serde, which only
accepts the canonical snake_case form.
Also:
- engine_by_id sort-order assertion now lists ids in ascending order
(matching ids.sort() output).
- parse_storage_backend_engine_id now recognises 'double_write' /
'prometheus_remote' (the JSON 'engine:' string for Mode-3 /
double-write configurations), so json_payload_prometheus_remote_*
resolves the engine correctly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zzylol
force-pushed
the
refactor/query-engine-storage-naming
branch
from
May 12, 2026 03:35
0f5bde2 to
392cc4f
Compare
5 tasks
zzylol
added a commit
that referenced
this pull request
May 12, 2026
…op of #137 Builds on top of PR #137's storage/engine naming split. Where #137 stopped at `query-engines/` + kept `data_model/`, `precompute_operators/`, `routing/`, two `controller_client.rs` files, and the `SimpleEngine` type, this PR finishes the reorg: - Crate rename: `asap-query-engine/` → `data_plane/` (folder + cargo package + binary name); the controller sibling is the "control plane" - `query-engines/` → `query_engines/` (snake_case) - Per-engine `_engine` suffix: - `asap_query/` → `asap_query_engine/` - `thanos_query/` → `thanos_query_engine/` - `prometheus/` → `prometheus_query_engine/` - `warm_tier/` promoted from `asap_query_engine/warm_tier/` to a top-level `query_engines/warm_tier/` (it's shared infra, not asap_query-specific) - `data_model/` → `stores/schema/` (storage schema types belong with storage) - `precompute_operators/` → `precompute_engine/operators/` (accumulator impls belong under the engine that orchestrates them) - `routing/` → `query_engines/routing/` (engine dispatcher, scoped to query path) - `drivers/controller_client.rs` + `drivers/query/controller_client.rs` co-located into `drivers/controller_client/{config_fetcher.rs, miss_notifier.rs, mod.rs}` - `stores/promsketch_store/` deleted (was commented out of the public API; not referenced) - `SimpleEngine` struct renamed to `ASAPQueryEngine` (was a type alias on main); compat alias removed Test counts after the reorg match origin/main: - data_plane lib: 804 passed / 2 pre-existing failures (schema_timeline_dispatch_tests, documented in controller_todo §5) / 4 ignored - controller lib: 710/710; bins: 27/27 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zzylol
added a commit
that referenced
this pull request
May 12, 2026
…nsolidate MutableEpoch dedup, write phase 5 plan doc Three follow-ups: 1) Move `query_engines/warm_tier/` back into `query_engines/asap_query_engine/warm_tier/`. The earlier reorg promoted it on the assumption it was shared infra; audit shows only `asap_query_engine::engine` consumes it. PR #137's original nesting was correct. 2) Consolidate the duplicate `MutableEpoch` / `SealedEpoch` / `InternTable` implementations. Before: ~290 LOC of identical storage logic in `sketch_db/store/common.rs` (non-generic, payload = `Arc<dyn AggregateCore>`) and `sketch_db/index/epoch_columnar.rs` (generic over `P`). After: `store/common.rs` is a 50-LOC alias shim (`pub type MutableEpoch = epoch_columnar::MutableEpoch<Arc<dyn AggregateCore>>`, etc.); the generic version is the single implementation. Required adapter methods added on the generic side, gated on `P: Clone` where the legacy semantics needed owning copies: - `MutableEpoch::range_query_into_grouped` — emits the `HashMap<LabelValuesId, Vec<(TimestampRange, P)>>` shape `SketchStore` callers consume. - `MutableEpoch::exact_query_owned` — `Option<Vec<(LabelValuesId, P)>>` for cross-lock-boundary handoff. - `MutableEpoch::remove_windows` — ReadBased / CircularBuffer cleanup primitive. - `MutableEpoch::time_bounds` / `seal` — convenience wrappers. - Same triplet on `SealedEpoch` plus `distinct_window_count` and `unique_windows`. Fixed a latent UB in `SealedEpoch::from_mutable`: previously used `MaybeUninit::zeroed().assume_init()` + `mem::forget` to drain the payload column, which is undefined behavior for any `P` with non-trivial Drop. Replaced with safe `into_iter().zip(...)` — same O(M) cost, works for arbitrary `P` (including `Arc<dyn AggregateCore>`). Made `SealedEpoch.entries` public to match the legacy access pattern (a handful of call sites in `store/{global,per_key}.rs` read it directly for diagnostics + persistence flush). 3) Wrote `data_plane/docs/phase5-unification-plan.md` covering the three in-flight Phase-5 migrations: - M1: `AggSchema` → `SketchInstanceMetadata` (lifecycle fold) - M2: `aggregation_id` → `sid` (data-path identifier) - M3: legacy `Arc<dyn AggregateCore>` payload type retires File-by-file phases A–E, ordering, dependencies on the analyzer chain α-ε and Step Z legacy_expr, and a ~5-day estimate. Test counts unchanged: - data_plane lib: 792 passed / 2 pre-existing failures / 4 ignored - controller lib: 710/710; bins: 27/27 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
ASAPQueryEngineandThanosQueryEngineSketchStoreandGorillaObjectStorethanos_archive,register_aliased, andThanosForwardEngineVerification
cargo test -p asap_types streaming_config::tests::deserialize_with_explicit_archive_pin -- --nocapturecargo check -p query_engine_rust --libcargo check -p controller --libcargo test -p query_engine_rust --lib --no-rungit diff --checkrg "SketchWarmTier|GorillaS3Archive|sketch_warm_tier|gorilla_s3_archive|thanos_archive|register_aliased|with_query_engine_aliased|ThanosForwardEngine|ThanosForwardConfig|ThanosForwardError|DATA_SOURCE_THANOS_ARCHIVE" crates/asap_types/src asap-query-engine/src controller/src --glob "*.rs"