Skip to content

docs: archive-tier consolidation — delete JSONL + PromQL completeness on GorillaQueryEngine - #292

Merged
zzylol merged 2 commits into
mainfrom
docs/jsonl-deprecation-design
May 7, 2026
Merged

zzylol merged 2 commits into
mainfrom
docs/jsonl-deprecation-design

Conversation

@zzylol

@zzylol zzylol commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Updated to reflect post-v5/v6/v6.1/v7 state. Original 3-phase plan was partially superseded by what shipped:

What's in the rewritten doc

  • §"What's already on main" — diff table showing what each prior phase ended up as
  • §"Goal" — two outstanding items only:
    1. Delete the JSONL cold-fallback (mechanical; ~500 LOC + tests + a gateway exporter)
    2. PromQL completeness on GorillaQueryEngine (Path A vendor prometheus/promql via sidecar / Path B pure-Rust evaluator / Path C curated subset extension)
  • §"Sequencing relative to the paper deadline" — Phase A1 in 1-2 days, Path C in ~1 week, Path A as post-deadline follow-up

Recommendation: Path A (vendor Prometheus' promql reference engine), with Path C as bridge if deadline forces. Optional bonus: promote ASAP archive-tier blocks to Prometheus-block format so Thanos store-gateway can answer queries directly (cross-references comparison doc).

Test plan

🤖 Generated with Claude Code

zzylol and others added 2 commits May 6, 2026 15:38
…QL completeness

Three-phase proposal to collapse ASAP's cold-fallback tier (JSONL) into
the Gorilla-S3 archive tier:

- Phase 1: always-archive every metric at the gateway (mirrors
  Databricks' Hydra always-streaming pattern); ~1-2 days
- Phase 2: delete the JSONL path (LocalFsColdStore, parse_jsonl, raw-tee
  exporter, StorageBackend::ColdJsonlFallback enum variant, paper §Cold-
  fallback tier prose, cost-model "cold-tier scan bytes" line item);
  ~1-2 days
- Phase 3: PromQL completeness on GorillaQueryEngine. Three sub-paths:
  Path A (vendor Prometheus' promql package, ~2 weeks, recommended for
  correctness), Path B (pure-Rust evaluator, ~4-6 weeks, correctness
  risk), Path C (extend curated subset, ~1 week, ships fast but
  reviewers may push back).

Recommends Phase 1+2 combined for paper deadline (drops cold-fallback
prose); Phase 3 ships as Path C bridge with Path A as post-deadline
follow-up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The original 3-phase plan (always-archive at gateway / delete JSONL /
PromQL completeness) is partially superseded by what shipped via v5/v7.
Updated to reflect what's already on main and what genuinely remains:

- "Always-archive at gateway" effectively shipped via dual-routing
  (PR #91): BackendStorageRouting now allows multi-target per metric
- The archive-tier engine has gained postings filtering (PR #295),
  partial-S3 reads (PR #295), concat-only compactor (PR #295), and
  freshness-pattern registration (PR #91)

Two outstanding items remain:
- Delete the JSONL cold-fallback (now safely unreachable under normal
  routing)
- PromQL completeness on GorillaQueryEngine (Path A: vendor
  prometheus/promql via sidecar; Path B: pure-Rust evaluator; Path C:
  curated subset extension)

Adds a "what's already on main" diff table at the top so reviewers
immediately see what's done vs. what's outstanding. Adds a sentence
about Prometheus-block-compatible layout potentially letting Thanos
store-gateway answer queries directly (cross-references the
comparison doc).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol zzylol changed the title docs: design for JSONL deprecation + Gorilla PromQL completeness docs: archive-tier consolidation — delete JSONL + PromQL completeness on GorillaQueryEngine May 7, 2026
@zzylol
zzylol merged commit 91b53f5 into main May 7, 2026
@zzylol
zzylol deleted the docs/jsonl-deprecation-design branch May 7, 2026 17:16
zzylol added a commit that referenced this pull request May 18, 2026
…ave queries + stale bucket key (#394)

Four orthogonal fixes that together make the multinode harness validate
the post-#290/#291/#292 sum-by-zone wave end-to-end on the ASAP arm.

1. run_demo.sh::backend_up() now brings up an asap-controller container
   on node2 alongside asap-backend, mirroring the singlenode
   docker-compose base.yml. Post-Phase-9 the controller and backend are
   two binaries in the same asap/query-backend:dev image but distinct
   processes; without the standalone controller the backend stays on
   the static DDSketch-only fallback (no Sum/Topk roles) and the
   wave queries silently return empty. Started after the backend so the
   startup pre-pop replan_all tick has a live POST target
   (CONTROLLER_BACKEND_ENDPOINT=http://backend:9091/api/v1/streaming-config,
   full URL form matching backend_client::BackendClient::new contract).
   Stale CONTROLLER_* env vars on the backend container removed; they
   were pre-Phase-9 carry-over the backend never reads. topology.env's
   "controller in-process" comment updated to reflect separate-container
   reality.

2. scripts/run_demo.sh:387 had `--endpoint`; the actual metricsql_replay.py
   arg is `--target`. Replay was silently failing argparse and the
   exception path returned 0 successes. Fixed.

3. queries-e2e.json extended with the wave's 3 marquee queries:
   `sum by (zone) (http_requests_total)`,
   `sum by (zone) (rate(http_requests_total[5m]))`,
   `topk(5, sum by (zone) (rate(http_requests_total[5m])))`.

4. agent yamls (mvp-multinode + mvp-singlenode) still set
   `bucket: asap-gorilla`, but PR #388 deleted the Bucket field from
   gorillas3processor/config.go (only `tsdb_bucket` remains). Result:
   agent crash-loop with `'gorillas3' ... '' has invalid keys: bucket`.
   Line removed from both yamls; comment references #388.

## Validation (sync + arm asap, ASAP arm)

- replay.jsonl: 384 success lines (was 0 pre-fix); all 3 wave queries
  show success: `sum by (zone) (http_requests_total)` (128),
  `sum by (zone) (rate(http_requests_total[5m]))` (128),
  `topk(5, sum by (zone) (rate(http_requests_total[5m])))` (128).

- Controller logs confirm typed-stage-split JSON POST succeeded for
  each (metric, role) pair: top_endpoint_qps/topk,
  request_size_bytes/quantile, http_requests_total/sum, etc. — all
  hitting http://backend:9091/api/v1/streaming-config with 2xx.

- Agent logs: clean startup, no crash-loop, all 7 gorillas3 pipeline
  instances (raw_passthrough, ddsketch_path, hll_path, kll_path,
  countminsketch_path, countsketch_path) starting with
  `tsdb_bucket: asap-gorilla-tsdb` (no `bucket:` field). TSDB blocks
  written.

- Manual probe against http://10.10.1.3:9091/api/v1/query, all returning
  `data_source: asap_query`:
  * `sum by (zone) (http_requests_total)` →
    z0:981128625, z1:981127610, z2:981127004, z3:981125787
  * `sum by (zone) (rate(http_requests_total[5m]))` →
    z0:4798703.10, z1:4798695.49, z2:4798690.49, z3:4798680.18
  * `topk(5, sum by (zone) (rate(http_requests_total[5m])))` →
    same 4 zones (only 4 exist; topk(5) returns all)
  * `quantile_over_time(0.99, http_requests_total_latency_ms[5m])` →
    empty (the multinode producer only emits http_requests_total, no
    _latency_ms; pre-existing harness gap, orthogonal to this PR).

- Teardown clean.

## Out-of-scope follow-up

Controller startup replan_all races the backend's /api/v1/streaming-config
handler bind: the first POST burst races the route registration and
some pushes get 404'd; subsequent OpAMP-on-connect re-fire makes the
plan converge anyway. Lives in ASAPQuery-backend, not addressed here.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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