Skip to content

fix(gorilla-s3): align prefix-template placeholder vocabulary with agent - #92

Merged
zzylol merged 1 commit into
mainfrom
mvp/v7-prefix-template-alignment
May 7, 2026
Merged

zzylol merged 1 commit into
mainfrom
mvp/v7-prefix-template-alignment

Conversation

@zzylol

@zzylol zzylol commented May 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Pre-v7 the backend's bucket_prefix accepted only {year}/{month}/{day}/{hour} placeholders, but the agent-side gorillas3processor (and the v6 demo's ASAP_GORILLA_S3_PREFIX_TEMPLATE) writes objects under the short-form {YYYY}/{MM}/{DD}/{HH} spelling. Result: when a deploy used the short-form template, the backend substituted {tenant} and {metric} but left the timestamp placeholders literal, so every index.json fetch issued a literal {YYYY}/{MM}/{DD}/{HH} path that missed the chunks on disk.

Why this matters

Issue #46 criterion ⑥ (freshness probes) surfaced as 0 samples on every path during the v7 demo even though:

  1. v7's routing table correctly routed last_over_time(http_freshness_probe_*[10s]) to the Gorilla engine.
  2. v7's LastOverTime planner accepted the query.
  3. The chunks were physically in MinIO at e.g. default/http_freshness_probe_archive/2026/05/07/04/part-*.gor.
  4. But the cold store fetched default/http_freshness_probe_archive/{YYYY}/{MM}/{DD}/{HH}/index.json — a literal path containing the placeholder text.

This PR aligns the placeholder vocabulary so the chunks are actually located. Backwards-compatible: long-form names still work; short-form aliases just resolve to the same value.

Test plan

  • 3 new unit tests: bucket_prefix_supports_long_form_placeholders, bucket_prefix_supports_agent_side_yyyy_mm_dd_hh_placeholders, bucket_prefix_handles_mixed_long_and_short_placeholders
  • cargo test -p query_engine_rust --lib bucket_prefix — 3/3 pass

🤖 Generated with Claude Code

Pre-v7 the backend's `bucket_prefix` accepted only the long-form
`{year}`/`{month}`/`{day}`/`{hour}` placeholders, but the agent-side
`gorillas3processor` (and the v6 demo deploy's
`ASAP_GORILLA_S3_PREFIX_TEMPLATE`) writes objects under the
short-form `{YYYY}`/`{MM}`/`{DD}`/`{HH}` spelling. So when a
deploy used the short-form template, `{tenant}` and `{metric}`
substituted but the timestamp placeholders stayed literal — every
backend `index.json` fetch issued a path like
`default/<metric>/{YYYY}/{MM}/{DD}/{HH}/index.json` that missed the
real chunks on disk.

Issue #46 criterion ⑥ (freshness probes) surfaced as 0 samples on
every path because of this — the chunks were on MinIO, the routing
table directed the query through the Gorilla engine, but the cold
store could not find them. v7 dual-routing closed the routing-side
gap; this aligns the placeholder vocabulary so the chunks are
actually located.

The fix accepts BOTH spellings; existing deploys using the long-form
keep working unchanged.

3 new tests: long-form preserved, agent-side aliases work,
mixed-form works.

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