Skip to content

perf(proxy): skip range presence probes on certified hits - #265

Merged
ovaistariq merged 2 commits into
mainfrom
perfloop-pr-open-bztn4ytrpm
Oct 21, 2026
Merged

ovaistariq merged 2 commits into
mainfrom
perfloop-pr-open-bztn4ytrpm

Conversation

@perfloop

@perfloop perfloop Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Range-created block-mode metadata now stores its initial contiguous block span only after every touched block is durable. A later multi-block Range wholly inside that span can skip the serial presence preflight on a complete hit.

The bounded, write-once hint is scoped to the metadata row's ETag and block size; blocks can evict independently. Legacy and metadata-only-on-write entries, out-of-span ranges and staging-budget declines keep their probe-first path. Certified requests stage the full range before headers so a missing or transient block can still take the existing pre-commit fallback.

The native handler benchmark sends a 4-MiB partial Range for a 5-MiB object with 1-MiB blocks. It signs the request before timing and validates each request through TAG's transparent SigV4 validator. The cold 206 comes from an in-process origin fixture; the benchmark does not contact a production S3 endpoint or real cluster. The delayed-remote case stores metadata in embedded RocksDB and serves blocks from a loopback gRPC in-memory owner with a fixed 2-ms delay per Get; the local control uses embedded RocksDB for both. The benchmark also includes 2-, 8-, and 32-block diagnostic rows; the official comparison below uses the four-block case. The Go benchmark ships, but its comparison adapter does not. Time-to-206 ends when response headers arrive. Its process CPU diagnostic includes the client, handler and in-process cache work, not production CPU.

warm 4-MiB partial S3 Range hit through handler with valid SigV4; 5-MiB object, 1-MiB blocks, delayed loopback gRPC block owner (9 paired runs): ns/op 19.73 ms → 8.809 ms (paired change -54.9%).

warm 4-MiB partial S3 Range hit through handler with valid SigV4; 5-MiB object, 1-MiB blocks, embedded RocksDB local owner (48 paired runs): declared guards passed.

The handler and proxy tests check exact same-span and contained-span bytes, zero presence probes and no warm origin calls. They also cover replacement and tombstones, first/middle eviction, transient failures, staging-budget decline and cancellation. The unit, build and lint checks passed, as did the focused block-cache integration and race checks.

Production request frequency, real peer latency and topology, and aggregate savings remain unmeasured.


Generated by Perfloop.


Note

Medium Risk
Changes block-mode Range serving and metadata publication; incorrect fast-path behavior could affect partial-content correctness, though pre-commit staging and existing fallbacks limit exposure.

Overview
Adds a write-once RangeBlockSpan hint to block-mode cache metadata: after a Range miss populates contiguous blocks, metadata records that inclusive block span (scoped to ETag and BlockSize) only once the blocks are durable.

Warm multi-block Range requests wholly inside that span can take a new certified fast path that stages every payload slice concurrently before committing 206, skipping the serial byte-zero presence preflight on a complete hit. Evictions, partial misses, staging-budget declines, and out-of-span ranges still use the existing probe/fetch/stream paths; first-slice transients or a 5s speculative-read cap fall back to upstream while the client context is live.

populateBlockMode is extracted so span publication and invalidation fencing stay testable; docs, RFC 0001, benchmarks, and broad integration/handler tests cover correctness and the measured warm-range latency win.

Reviewed by Cursor Bugbot for commit 3981e34. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

Adds a bounded RangeBlockSpan hint to range-created cache entries. Covered multi-block requests read all requested bytes before sending headers, avoiding presence probes on complete hits.

  • Warm multi-block ranges skip serial presence checks on certified hits.

No actionable issues were found. Review checks were static; tests and benchmarks were not run.

Reviews (1) · Last reviewed commit: "perf(proxy): skip presence probes for ce..." · Reviewed by Greptile

@ovaistariq
ovaistariq merged commit 5e8648b into main Oct 21, 2026
10 checks passed
@ovaistariq
ovaistariq deleted the perfloop-pr-open-bztn4ytrpm branch October 21, 2026 05:57
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 21, 2026
@tigrisdata-argocd-bot

Copy link
Copy Markdown

🎉 This PR is included in version 1.22.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants