Skip to content

refactor: tier-co-locate engines/{simple,gorilla}/ + delete JSONL legacy - #95

Merged
zzylol merged 1 commit into
mainfrom
refactor/engines-tier-colocation-and-jsonl-deletion
May 7, 2026
Merged

zzylol merged 1 commit into
mainfrom
refactor/engines-tier-colocation-and-jsonl-deletion

Conversation

@zzylol

@zzylol zzylol commented May 7, 2026

Copy link
Copy Markdown
Contributor

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.rsengines/simple/{mod,engine,tests}.rs
  • engines/gorilla_engine/{mod,query_planner,exact_executor}.rsengines/gorilla/{mod,engine}.rs (planner + executor MERGED into engine.rs)
  • drivers/query/fallback/cold_store/gorilla_s3.rsengines/gorilla/store.rs
  • drivers/query/fallback/cold_store/s3_cost_tracker.rsengines/gorilla/s3_cost.rs
  • postings cache + intersection helper extracted to engines/gorilla/postings.rs
  • engines/router.rsrouting/engine_router.rs
  • data_model/backend_storage_routing.rsrouting/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)

  • 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

  • GorillaS3ColdStoreGorillaS3Store
  • ColdStore (trait) → Store
  • ColdStoreErrorStoreError
  • MockColdStore (tests) → MockStore

Test plan

  • 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, verified by re-running on a clean main checkout with a separate CARGO_TARGET_DIR).
    • The 26-test delta vs main is the cold_fallback_tests + local_fs/format/s3_adapter inline tests intentionally deleted.

🤖 Generated with Claude Code

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>
@zzylol
zzylol merged commit 721f81b into main 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>
@zzylol
zzylol deleted the refactor/engines-tier-colocation-and-jsonl-deletion branch May 9, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant