Skip to content

fix(proxy): bound read-triggered Parquet footer scans - #237

Merged
ovaistariq merged 1 commit into
mainfrom
perfloop-pr-open-vcgmhnrgzk
Oct 21, 2026
Merged

ovaistariq merged 1 commit into
mainfrom
perfloop-pr-open-vcgmhnrgzk

Conversation

@perfloop

@perfloop perfloop Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Read-triggered Parquet footer scans now take one of 32 nonblocking slots per service before a background marker or worker is created. When the limit is full, the read trigger is shed without a cooldown and can retry on a later tail read. Duplicate triggers release their spare slot; write-triggered warming remains separate. Transient trailer-cache and populate failures remain retryable, while stable invalid trailers still start the cooldown. The foreground Range response remains unchanged.

The new tag_cache_parquet_footer_prefetch_shed_total counts eligible read-trigger attempts refused by the scan limit. It signals admission pressure, not the number of distinct footer samples omitted: admission precedes version coalescing, so a refused attempt can be for a version another scan is already handling. The metrics and Parquet guides explain this alongside the footer-size histogram.

The controlled workload served distinct HandleGetObject tail Range GETs for 64 MiB objects with 64 KiB blocks, cached tails, ~1.25% footers, and a loopback gRPC peer held 10 ms on footer-presence probes. Each timed operation ran ten 16/32/64-offer rounds; ten baseline/Candidate pairs used GOMAXPROCS=4. At 64 offers, peak live cache-peer Get streams fell from 64 to 32 (paired median reduction 32; 95% interval 32–32); the 16- and 32-offer controls stayed at 16 and 32. ns/op medians were 590,400,811.5 and 550,440,353, with a paired median reduction of 41,810,148 ns/op (95% interval 27,138,715–47,231,306); the no-regression guard passed. The timer includes the artificial stalls and scan drain, so it is not foreground request latency or production queue depth. Separate single-run foreground p99 diagnostics were 276,877 ns and 122,182 ns; no p99 bound is claimed.

The admission tests cover global shedding and retry, duplicate permit release, transient versus stable trailer results, and write warming. TestMaybePrefetchParquetFooter_StreamedTriggerShedsBeforeTrailerRead verifies the new counter while ensuring a declined streamed trigger still performs no cache read or worker start. make lint-ci, make build, make test, make test-integration, make test-race, and make test-coverage passed.

On the previous PR head, the default S3 compatibility job passed make s3-tests but failed at make test-sdk; its log was unavailable here, so the failing SDK test is unknown. This sandbox has no AWS credentials or local TAG endpoint and could not run those external checks. Target CI should rerun both commands on this revision.

Checks: 6 passed.


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


Note

Medium Risk
Changes background Parquet prefetch admission and cooldown on a hot cache path; foreground Range responses are unchanged, but load shedding can defer metadata warming under burst tail reads.

Overview
Read-triggered Parquet footer prefetch now uses a service-wide cap of 32 concurrent scans. Each tail read must take a nonblocking slot before a background marker or goroutine is created; when the limit is full the trigger is shed (no trailer read, no cooldown) and can retry on a later read. Duplicate same-version triggers release the spare permit; write-time footer warming stays on its own path.

Adds tag_cache_parquet_footer_prefetch_shed_total and tightens tag_cache_parquet_footer_bytes semantics: the histogram only reflects admitted read scans and write warms, so saturation can skew the sample. Docs in metrics.md and parquet-optimization.md describe the limit and how to interpret shedding.

Cooldown now distinguishes stable negative trailers (cool down) from transient cache read or populate failures (remain retryable). parquetFooterLength returns a complete flag to drive that behavior.

New admission tests cover global shedding/retry, duplicate slot release, transient vs stable trailer handling, shed-before-read (no cache I/O), and write warm bypassing the read limit.

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

@greptile-apps

greptile-apps Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adds admission control to Parquet footer prefetch scans.

The PR appears safe to merge based on the reviewed changes.

Summary

The PR bounds concurrent read-triggered Parquet footer scans, keeps shed attempts retryable, and adds a counter and documentation for admission pressure. The previously reported missing shed metric is addressed.

Reviews (2) · Last reviewed commit: "fix(proxy): report shed Parquet footer s..."

Comment thread proxy/block_cache_parquet.go Resolved
@perfloop
perfloop Bot force-pushed the perfloop-pr-open-vcgmhnrgzk branch from 9304b0c to 3b2e486 Compare September 27, 2026 21:34
@ovaistariq
ovaistariq merged commit 6fd9787 into main Oct 21, 2026
11 checks passed
@ovaistariq
ovaistariq deleted the perfloop-pr-open-vcgmhnrgzk branch October 21, 2026 05:55
@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