Skip to content

perf: skip write-through tee for cache-rejected PUTs - #173

Merged
ovaistariq merged 2 commits into
mainfrom
perfloop-pr-open-esjakbxzet
Aug 20, 2026
Merged

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

Conversation

@perfloop

@perfloop perfloop Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

What

Skip write-through tee admission for PUTs with an exact request Cache-Control: no-store or private directive. These requests still forward and invalidate existing cache data, but no longer reserve cache-populate capacity, issue a metadata HEAD, publish a cache entry, or start a warm-on-write fetch.

Keep the HEAD-verified tee path for cacheable and no-cache PUTs. Repeated fields and quoted extension values are parsed so only exact directives opt out. Add handler benchmarks that count metadata HEADs and wait for detached commits.

Testing

  • go test -v -timeout 30s -count=1 ./proxy/...
  • go test -race -timeout 60s -count=1 ./proxy -run '^TestHandlePutObject_WriteThroughTee_'
  • make lint-ci

Workload: completed 64 KiB no-store PUT with cacheable origin metadata

Metric Before After Change
upstream_HEADs/op 1 0 100% lower
ns/op 162073 6547 96% lower
Checks: 3 passed.

Generated by Perfloop. Measurements and checks.


Note

Cursor Bugbot is generating a summary for commit a218adb. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown

Greptile Summary

This PR avoids write-through tee admission and subsequent warm-on-write fetches when a PUT explicitly declares Cache-Control: no-store or private.

  • Adds exact, case-insensitive parsing of repeated and comma-separated Cache-Control directives.
  • Propagates request cache rejection through PUT handling while retaining post-write invalidation.
  • Adds unit tests, handler tests, and benchmarks covering direct forwarding, metadata HEAD counts, cache publication, and detached commits.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code defect identified.

Exact no-store/private request policies bypass tee and warm population without bypassing upstream forwarding or the required post-success cache invalidation, while cacheable and no-cache PUTs retain the HEAD-verified path.

Important Files Changed

Filename Overview
proxy/caching.go Adds directive-aware Cache-Control parsing, including repeated fields and quoted extension values.
proxy/write_through.go Rejects no-store/private PUTs before tee admission and reports that decision to the handler.
proxy/service.go Uses the request rejection result to skip read-back warming while preserving successful-write invalidation.
proxy/write_through_test.go Covers direct-forward rejection, exact directive matching, HEAD suppression, cache-slot release, and retained cacheable behavior.
proxy/write_through_benchmark_test.go Benchmarks cacheable and no-store PUT paths while synchronizing detached cache commits and counting metadata HEADs.

Reviews (1): Last reviewed commit: "perf: bypass tee for cache-rejected PUTs" | Re-trigger Greptile

@ovaistariq
ovaistariq merged commit 3b31a54 into main Aug 20, 2026
10 checks passed
@ovaistariq
ovaistariq deleted the perfloop-pr-open-esjakbxzet branch August 20, 2026 07:06
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 20, 2026
@tigrisdata-argocd-bot

Copy link
Copy Markdown

🎉 This PR is included in version 1.18.0 🎉

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.

3 participants