Skip to content

fix: stop block fetch admission after populate expiry - #240

Merged
ovaistariq merged 4 commits into
mainfrom
perfloop-pr-open-v1ntp4ekze
Oct 21, 2026
Merged

ovaistariq merged 4 commits into
mainfrom
perfloop-pr-open-v1ntp4ekze

Conversation

@perfloop

@perfloop perfloop Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

fetchBlocksToCache now returns immediately for empty input, checks the parent context before each errgroup submission and again when a task starts, and returns the context error after draining when cancellation stops admission, unless a stale result was collected. fetchOneBlock also rechecks the context under blockFetchMu before creating a new state; active same-key states still coalesce, and states admitted before cancellation remain detached.

The 32-block test synchronizes four upstream GET starts, snapshots state, probes, GETs, and populate permits, then cancels the parent and verifies the four detached writes finish after the batch returns. A second test pauses a task after its entry check and cancels before state admission; the stale-ETag test continues to verify invalidation priority. The tests use controlled cancellation after the first wave rather than a short wall-clock deadline. The production five-minute timeout is unchanged; timeout frequency and aggregate production cost remain unknown.

The 32-block assertion is violated at 0464aad5ab5cd78a97b6e6ed8cba7b194f4f6137 and satisfied at the final revision; run it with sh proof/check-fetch-block-deadline.sh. The task-check/lock-window assertion is violated at f5ab43a10570bb64faceb3e1c007e766c0f8f0e6 and satisfied at the final revision; run it with sh proof/check-fetch-block-admission-race.sh.

Recorded proof ran with retained support that is not included in this pull request.

Passed checks: make test, make lint-ci, make test-race, make test-integration, and make test-coverage. The local block-mode S3 compatibility check was not run because Tigris credentials were not configured. Target CI also runs S3 Compatibility Tests / s3-compat-tests (default and tiered) and S3 Compatibility Tests (Cluster) / s3-compat-tests-cluster (default).


Generated by Perfloop. Measurements and checks. Reproduce this comparison (tenant access required).

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Changes block fetch cancellation behavior in the cache layer.

The PR appears safe to merge; both previous findings are addressed and no new actionable issue was identified.

Summary

The PR stops admitting new block-fetch states after populate-context cancellation while allowing previously admitted fetches to finish. It also replaces a scheduling-dependent deadline test with controlled cancellation and adds a test for cancellation between task entry and state admission.

Reviews (2) · Last reviewed commit: "fix: gate block fetch admission on conte..."

Comment thread proxy/block_cache.go Resolved
Comment thread proxy/block_cache_deadline_test.go Resolved
@perfloop
perfloop Bot force-pushed the perfloop-pr-open-v1ntp4ekze branch from 9e48dbe to a92e7d6 Compare October 1, 2026 21:30
@ovaistariq
ovaistariq merged commit 4155409 into main Oct 21, 2026
12 checks passed
@ovaistariq
ovaistariq deleted the perfloop-pr-open-v1ntp4ekze branch October 21, 2026 05:53
@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.

3 participants