refactor: tier-co-locate engines/{simple,gorilla}/ + delete JSONL legacy - #95
Merged
Merged
Conversation
Step-1 of the JSONL deprecation: lift the warm/archive engines into
tier-co-located directories, lift the dispatcher into a dedicated
routing/ module, and delete the §5.2 local-FS JSONL fallback path
outright. Step-2 (Prometheus-block format + Thanos store-gateway as
the archive query engine) lands in a separate dispatch.
Layout changes (asap-query-engine/src/):
* engines/simple_engine.rs → engines/simple/{mod,engine,tests}.rs
* engines/gorilla_engine/{mod,query_planner,exact_executor}.rs
→ engines/gorilla/{mod,engine}.rs
(planner + executor MERGED into engine.rs)
* drivers/query/fallback/cold_store/gorilla_s3.rs
→ engines/gorilla/store.rs
* drivers/query/fallback/cold_store/s3_cost_tracker.rs
→ engines/gorilla/s3_cost.rs
* postings cache + intersection helper extracted to
engines/gorilla/postings.rs
* engines/router.rs → routing/engine_router.rs
* data_model/backend_storage_routing.rs
→ routing/backend_storage_routing.rs
* routing/mod.rs added; data_model::* re-exports the routing types
so existing callers keep compiling
Deletions (no jsonl_legacy/ parking lot — direct delete):
* drivers/query/fallback/cold_store/local_fs.rs (LocalFsColdStore)
* drivers/query/fallback/cold_store/format.rs (parse_jsonl + the
RawSample wire format + torn-trailing-line tolerance + pin tests)
* drivers/query/fallback/s3_adapter.rs (the §5.2 ColdFallback adapter)
* drivers/query/fallback/cold_store/ directory itself
* tests/cold_fallback_tests.rs (whole file)
* StorageBackend::ColdJsonlFallback enum variant
* compatible_storage_backends ColdJsonlFallback failover slot
* AdapterConfig::prometheus_promql_with_cold +
::from_prom_with_optional_cold constructors
* main.rs / precompute_engine.rs --cold-store-root flag +
ASAP_COLD_STORE_ROOT env var
Renames in the gorilla module:
* GorillaS3ColdStore → GorillaS3Store
* ColdStore (trait) → Store
* ColdStoreError → StoreError
* MockColdStore (tests) → MockStore
cargo build --release: green.
cargo test --release --lib: 856 passed, 33 failed (every failing
test also fails on origin/main — pre-existing bugs in
schema_timeline_dispatch + datafusion plan_execution; the 26-test
delta vs main is the cold_fallback_tests + local_fs/format/s3_adapter
inline tests intentionally deleted).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 7, 2026
zzylol
added a commit
that referenced
this pull request
May 7, 2026
The repo is now the backend query engine of the ASAP observability system, not a standalone Prometheus-front query accelerator. Reflects the architecture that landed via: - Step 1 (#95) — engines/{simple,gorilla}/ tier-co-located layout, routing/ split out from drivers/, JSONL legacy code deleted - Phase α (#314 controller, #96 backend) — controller emits BackendStorageRouting JSON; backend hot-loads via HTTP push - Phase β (#315) — asap-planner-rs library's 5 PromQL patterns + 11 archive-only intents migrated into ASAPCollector controller's L3 intent_algebra + L4 sketch_algebra - Step 2.3 (#97) — ThanosForwardEngine in engines/gorilla/thanos_forward.rs; HTTP-forwards archive queries to thanos-query for full PromQL surface (Path A2) Key narrative changes: - Lead with two-engine architecture (warm sketch tier + archive via Thanos), not the single-tier query-accelerator framing - Explicit "Where the planner lives" section pointing at the ASAPCollector controller (was previously asap-planner-rs in this repo) - Repository layout reflects the new engines/{simple,gorilla}/ + routing/ split - Configuration via env vars (ASAP_THANOS_QUERY_URL, ASAP_GORILLA_S3_*, CONTROLLER_BACKEND_ENDPOINT) matching the current code - Query response infos shows the three data_source values (warm / gorilla_archive / thanos_archive) - "What's NOT in this repo" section enumerates the migrations and deletions for reviewers landing here from old docs - "What's still planned" tracks Phase δ (backend pure executor), per-tenant routing, hot-reload signal Drops: 100x latency reduction headline (was the asap-quickstart v0.1.0 framing — still true qualitatively but not the lede); the 4-component repo-structure diagram (most of those components either moved or have changed scope). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zzylol
added a commit
that referenced
this pull request
May 7, 2026
The repo is now the backend query engine of the ASAP observability system, not a standalone Prometheus-front query accelerator. Reflects the architecture that landed via: - Step 1 (#95) — engines/{simple,gorilla}/ tier-co-located layout, routing/ split out from drivers/, JSONL legacy code deleted - Phase α (#314 controller, #96 backend) — controller emits BackendStorageRouting JSON; backend hot-loads via HTTP push - Phase β (#315) — asap-planner-rs library's 5 PromQL patterns + 11 archive-only intents migrated into ASAPCollector controller's L3 intent_algebra + L4 sketch_algebra - Step 2.3 (#97) — ThanosForwardEngine in engines/gorilla/thanos_forward.rs; HTTP-forwards archive queries to thanos-query for full PromQL surface (Path A2) Key narrative changes: - Lead with two-engine architecture (warm sketch tier + archive via Thanos), not the single-tier query-accelerator framing - Explicit "Where the planner lives" section pointing at the ASAPCollector controller (was previously asap-planner-rs in this repo) - Repository layout reflects the new engines/{simple,gorilla}/ + routing/ split - Configuration via env vars (ASAP_THANOS_QUERY_URL, ASAP_GORILLA_S3_*, CONTROLLER_BACKEND_ENDPOINT) matching the current code - Query response infos shows the three data_source values (warm / gorilla_archive / thanos_archive) - "What's NOT in this repo" section enumerates the migrations and deletions for reviewers landing here from old docs - "What's still planned" tracks Phase δ (backend pure executor), per-tenant routing, hot-reload signal Drops: 100x latency reduction headline (was the asap-quickstart v0.1.0 framing — still true qualitatively but not the lede); the 4-component repo-structure diagram (most of those components either moved or have changed scope). 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
Step-1 of the JSONL deprecation: lift the warm/archive engines into tier-co-located directories, lift the dispatcher into a dedicated
routing/module, and delete the §5.2 local-FS JSONL fallback path outright. Step-2 (Prometheus-block format + Thanos store-gateway as the archive query engine) lands in a separate dispatch.Layout changes
asap-query-engine/src/:engines/simple_engine.rs→engines/simple/{mod,engine,tests}.rsengines/gorilla_engine/{mod,query_planner,exact_executor}.rs→engines/gorilla/{mod,engine}.rs(planner + executor MERGED intoengine.rs)drivers/query/fallback/cold_store/gorilla_s3.rs→engines/gorilla/store.rsdrivers/query/fallback/cold_store/s3_cost_tracker.rs→engines/gorilla/s3_cost.rsengines/gorilla/postings.rsengines/router.rs→routing/engine_router.rsdata_model/backend_storage_routing.rs→routing/backend_storage_routing.rsrouting/mod.rsadded;data_model::*re-exports the routing types so existing callers keep compilingDeletions (no
jsonl_legacy/parking lot)drivers/query/fallback/cold_store/local_fs.rs(LocalFsColdStore)drivers/query/fallback/cold_store/format.rs(parse_jsonl + the RawSample wire format + torn-trailing-line tolerance + pin tests)drivers/query/fallback/s3_adapter.rs(the §5.2 ColdFallback adapter)drivers/query/fallback/cold_store/directory itselftests/cold_fallback_tests.rs(whole file)StorageBackend::ColdJsonlFallbackenum variantcompatible_storage_backendsColdJsonlFallbackfailover slotAdapterConfig::prometheus_promql_with_cold+::from_prom_with_optional_coldconstructorsmain.rs/precompute_engine.rs--cold-store-rootflag +ASAP_COLD_STORE_ROOTenv varRenames in the gorilla module
GorillaS3ColdStore→GorillaS3StoreColdStore(trait) →StoreColdStoreError→StoreErrorMockColdStore(tests) →MockStoreTest plan
cargo build --releasegreencargo test --release --lib: 856 passed, 33 failedorigin/main(pre-existing bugs inschema_timeline_dispatch+datafusion plan_execution, verified by re-running on a clean main checkout with a separateCARGO_TARGET_DIR).cold_fallback_tests+local_fs/format/s3_adapterinline tests intentionally deleted.🤖 Generated with Claude Code