eval(fig7): cold-fallback latency arm — cold/archive-answered PromQL (was blocked) - #501
Merged
Merged
Conversation
…PromQL)
Previously the Fig 7 cold-fallback arm was BLOCKED ("archive/ship fragility,
MinIO stayed empty"). This adds the missing cold arm, measured live end-to-end
through the gorilla cold tier, keeping the warm numbers intact.
Root cause of the original block: the multisketch cold-on agent set only
`cold:{enabled:true}` with NO `ship_endpoint`, which the asapedge processor
treats as drain-only (config.go: "Empty => drain-only (no shipping)"), so the
cold encoder accumulated samples but never POSTed them -> MinIO/merger empty.
What unblocks it:
- agent-cold-ship.yaml: cold-enabled edge with a COMPLETE cold block
(ship_endpoint -> gorilla-merger /ingest/gorilla, block_duration, non-empty
external_labels). The edge then ships 1000-series ASAPFRG1 fragments to the
merger (cold ship is decoupled from the control channel, PR #500).
- stack-coldon.sh: cold-ON single-host stack (MinIO + gorilla-merger + thanos
store-gateway/query + data-plane with ASAP_THANOS_QUERY_URL so it registers
the real ThanosQueryEngine). Runs docker via sudo; --user 0 on the merger so
it can write its bind-mounted /data (distroless nonroot couldn't mkdir).
- backend-storage-routing-coldon.yaml: pins
google_cluster_2019_cpu_rate -> gorilla_object_store so its instant queries
dispatch to the cold/archive engine (data_source=thanos_query).
- cold_latency_replay.py: cold replay client that pins the PromQL eval time to
the cold-window anchor (the cold window sits at a fixed past instant once the
ship lands), so every cold query deterministically hits the archived window.
- compute_latency.py: extended to reduce + render BOTH arms and to GUARD each
arm's data_source (warm must be asap_query, cold must be thanos_query) so a
warm shortcut can't masquerade as cold.
Measured (real gct, 15 QPS, guard-verified, 600/600 data_source=thanos_query,
0 empties/errors):
cold-fallback all (mix): p50 22.28 / p95 47.17 / p99 67.07 ms (n=600)
quantile_over_time (1000-series, Thanos over raw samples): p50 24.27 / p99 68.41
sum (lossless archive): p50 15.48 / p99 42.74
vs warm (unchanged): all p50 18.25 / p99 20.03 ms.
=> overall p50 ~1.2x warm, p99 ~3.3x warm; cold stays in the tens of ms (no
order-of-magnitude blowup) with a heavier p99 tail (data-plane -> thanos-query
-> merger StoreAPI + store-gateway, re-evaluating PromQL over raw Gorilla-XOR
samples). Single-node loopback (server-side latency only, no network RTT).
Updates latency_RESULTS.md (new Cold-fallback arm section + reproduce), the
combined warm-vs-cold latency_cdf.png + latency_summary.json, and Fig 7 in
docs/evaluation-plan-figures.md (was "cold-fallback arm blocked").
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts: # docs/evaluation-plan-figures.md
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.
What
Adds the Fig 7 cold-fallback latency arm — the p50/p95/p99 latency of cold/archive-answered PromQL — which was previously BLOCKED ("archive/ship fragility, MinIO stayed empty"). Measured live end-to-end through the gorilla cold tier. The warm numbers are kept intact.
Result (real gct, 15 QPS, guard-verified)
600/600 timed queries served by
data_source=thanos_query(the cold/archive engine), 0 empties, 0 errors:quantile_over_time(1000-series, Thanos over raw samples)sum(lossless archive)Overall p50 ≈ 1.2× warm, p99 ≈ 3.3× warm — the cold path stays in the tens of ms (no order-of-magnitude blowup) with a heavier p99 tail (data-plane → thanos-query → gorilla-merger StoreAPI + store-gateway, re-evaluating PromQL over raw Gorilla-XOR samples). Single-node loopback (server-side latency only, no network RTT).
Why it was blocked, and the fix
The original cold arm's agent set only
cold:{enabled:true}with noship_endpoint— the asapedge processor treats an empty endpoint as drain-only, no shipping (config.go: "Empty => drain-only (no shipping)"). So the cold encoder accumulated samples but never POSTed them → MinIO/merger stayed empty.With a complete cold block (
ship_endpoint→ gorilla-merger,block_duration, non-emptyexternal_labels), the edge ships 1000-series ASAPFRG1 fragments to the merger (cold ship is decoupled from the control channel — PR #500). Verified: per-shardcold drain/shipBatchshipped without spool/fail, then thanos servedcount(...)=1000.How the cold path is forced & verified
backend-storage-routing-coldon.yamlpinsgoogle_cluster_2019_cpu_rate → gorilla_object_store, so its instant queries dispatch to theThanosQueryEngine(data_source=thanos_query).cold_latency_replay.pypins the PromQL eval timestamp to the cold-window anchor (the cold window sits at a fixed past instant once the ~one-window ship lands), so every cold query deterministically hits the archived window.compute_latency.pyhard-fails if any cold query was notthanos_query(or any warm query notasap_query), so a warm shortcut can't masquerade as cold.Files
New:
stack-coldon.sh,agent-cold-ship.yaml,backend-storage-routing-coldon.yaml,cold_latency_replay.py,queries-latency-cold.json,per_query_latency_cold.json. Updated:compute_latency.py(both arms + per-armdata_sourceguard),latency_RESULTS.md(new Cold-fallback arm section + reproduce),latency_cdf.png+latency_summary.json(warm vs cold),docs/evaluation-plan-figures.mdFig 7 (was "cold-fallback arm blocked").🤖 Generated with Claude Code