Skip to content

fix(gorilla-s3): prefix bare-basename keys from agent-produced index entries - #93

Merged
zzylol merged 3 commits into
mainfrom
mvp/v7-cold-store-bare-key-prefix
May 7, 2026
Merged

zzylol merged 3 commits into
mainfrom
mvp/v7-cold-store-bare-key-prefix

Conversation

@zzylol

@zzylol zzylol commented May 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #91 / #92 — the last hop of issue #46 ⑥ archive freshness.

The agent's gorillas3processor writes index.json entries with the chunk's basename in the object field (e.g. part-1778128694-000000.gor). The backend-produced index entries (and the existing IndexEntry test fixtures) carry the full S3 key (e.g. tenant1/metric/2026/05/06/12/part-A.gor).

list_chunks was passing entry.key through to ChunkRef.key unchanged, so for agent-produced entries the subsequent read_chunk issued GET against the bare basename and got "not found".

This PR detects a bare basename (!entry.key.contains('/')) and prepends the per-hour bucket_prefix(metric, hour_ms). Backend-produced full keys pass through unchanged.

Without this, the v7 demo's freshness phase still gets 0 archive-path samples even after #91 (planner accepts last_over_time) and #92 (placeholder vocabulary aligned).

Test plan

  • All 13 gorilla_s3 cold-store tests pass (existing tests use full keys; the bare-key path is exercised end-to-end by the v7 demo rerun)

🤖 Generated with Claude Code

zzylol and others added 3 commits May 7, 2026 00:18
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>
…entries

When the agent's gorillas3processor writes index.json, each entry's
`object` field carries just the chunk basename (e.g.
`part-1778128694-000000.gor`). Backend-produced entries carry the
full S3 key (e.g.
`tenant/metric/2026/05/07/04/part-1778128694-000000.gor`).

`list_chunks` was passing entry.key through to ChunkRef.key
unchanged, so subsequent `read_chunk` issued GET against the bare
basename and hit "not found". The agent-side index.json deserialize
landed in the v7 follow-ups, but the keys-need-prefixing tail is
only visible end-to-end.

Fix: in `list_chunks`, detect a bare basename (no `/` in entry.key)
and prepend the per-hour `bucket_prefix(metric, hour_ms)`. Preserves
backend-produced entry handling exactly (key already contains `/`).

Required for issue #46 criterion ⑥ archive freshness path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol merged commit 01d125f into main May 7, 2026
@zzylol
zzylol deleted the mvp/v7-cold-store-bare-key-prefix 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