Skip to content

fix: continue parquet footer warming after metadata-only HEAD - #239

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

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

Conversation

@perfloop

@perfloop perfloop Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

The change

A successful, non-replayed multipart completion can schedule metadata-on-write HEAD and Parquet footer warming together. For co-enabled .parquet writes, TAG now passes the completion ETag to the detached footer worker. If a metadata-only entry matching that ETag and block layout is already visible, the worker validates the suffix response and fills missing footer blocks without rewriting the entry. If the suffix is unsafe or mismatched, no footer blocks are published; when the guarded HEAD succeeds, its metadata remains available for ordinary range reads. The completion response still does not wait for either warm. The README and Parquet guide describe this behavior and the remaining cold-read window. No public API or configuration changes were added.

Tests

TestServer_CompleteMultipartUploadWarmsFooterForFirstOpen and TestServer_CompleteMultipartUploadFooterFirstStillWarms force both worker orders. TestServer_CompleteMultipartUploadSkipsFooterWhenVersionLookupFails, TestServer_CompleteMultipartUploadKeepsHeadOnSuffixETagMismatch, TestServer_CompleteMultipartUploadKeepsHeadWhenSuffixIsNotPartial, and TestServer_DeleteDuringFooterFetchDoesNotRepublishMetadata cover fallback conditions and deletion during a block fetch under legacy and CAS coordination. The completion request helper now sends request errors through the result channel so the test goroutine reports the request failure instead of a synchronization timeout.

The benchmark uses the registered handlers with a sparse document-shaped 300 MiB object, 3.5 MB footer, and 1 MiB blocks. It forces HEAD-first ordering, waits for warming to finish, then times the trailer and metadata range requests against a local origin with a fixed 5 ms range-response delay. Read-triggered prefetch remains enabled and is counted separately, so the reported origin work covers foreground first-open work, not total transfer. Footer bytes are moved before the open, not eliminated; an open before warming completes can still fetch missing blocks. This setup does not estimate production latency, HEAD-first frequency, or deployment adoption.

The measurement command is bash -o pipefail -c "\"$PERFLOOP_BUILD_OUTPUT_DIR/bench.test\" -test.bench=\"^BenchmarkParquetFirstOpenAfterMultipartWriteWarm$\" -test.run=\"^$\" -test.count=1 -test.benchtime=20x | perfloop-go-bench-json \"BenchmarkParquetFirstOpenAfterMultipartWriteWarm\" \"ns/op\" \"foreground_origin_gets/op\" \"foreground_origin_bytes/op\"".

On workload HEAD-first Parquet open after multipart completion (300 MiB object, 3.5 MB footer, 1 MiB blocks), median metric foreground_origin_gets/op changed from 1 to 0; paired median delta -1 (-100% of baseline; at least 19/20 confidence interval -1 to -1 from 10 pairs).

On workload HEAD-first Parquet open after multipart completion (300 MiB object, 3.5 MB footer, 1 MiB blocks), median metric foreground_origin_bytes/op changed from 262144 to 0; paired median delta -262144 (-100% of baseline; at least 19/20 confidence interval -262144 to -262144 from 10 pairs).

The following checks passed: make lint-ci, bash -o pipefail -c "TAR_OPTIONS=--no-same-owner make build", bash -o pipefail -c "TAR_OPTIONS=--no-same-owner make test", bash -o pipefail -c "TAR_OPTIONS=--no-same-owner make test-race", and bash -o pipefail -c "TAR_OPTIONS=--no-same-owner make test-coverage".

Target CI also runs the integration step in Test / test, S3 Compatibility Tests / s3-compat-tests (default, tiered), S3 Compatibility Tests (Cluster) / s3-compat-tests-cluster (default), Lint PR Title / lint, and CLA Assistant / cla.


Generated by Perfloop. Measurements and checks.


Note

Medium Risk
Changes multipart post-write cache warming and metadata/block publication ordering; mistakes could skip warming or publish blocks under wrong ETags, though guards and extensive tests target those paths.

Overview
Multipart completion with cache.meta_on_write and cache.parquet_optimization now passes the completion ETag into the detached footer warm. The worker no longer bails out just because a metadata-only HEAD entry is already visible: when that entry matches the write ETag and block layout, it validates the suffix-range response and fills missing footer blocks without rewriting metadata; unsafe or mismatched suffix responses leave the HEAD entry intact and skip block publication.

HandleCompleteMultipartUpload wires this only for co-enabled .parquet keys; PUT/copy paths still call the ETag-less warm helper. README and docs/parquet-optimization.md describe the independent HEAD/footer workers and the race window before warm finishes.

Large handler integration tests (legacy and CAS) cover success, footer-before-HEAD ordering, token lookup failure, suffix ETag/status guards, delete-during-fetch, and a benchmark for first-open origin GET/byte counts after warm.

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

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Parquet footer warming now validates against multipart write ETag.

The PR appears safe to merge; no outstanding finding or new actionable issue was identified.

Summary

The PR lets multipart Parquet footer warming continue when a matching metadata-only HEAD entry appears first, while retaining ETag and block-layout checks. It also adds ordering and fallback tests, a first-open benchmark, and documentation of the remaining cold-read window.

Reviews (2) · Last reviewed commit: "fix: report multipart request errors wit..."

Comment thread handlers/parquet_multipart_warm_test.go Resolved
@perfloop
perfloop Bot force-pushed the perfloop-pr-open-j54y2swdnw branch from dc2e2c5 to 20415df Compare October 2, 2026 01:14
@ovaistariq
ovaistariq merged commit c96f326 into main Oct 21, 2026
11 checks passed
@ovaistariq
ovaistariq deleted the perfloop-pr-open-j54y2swdnw branch October 21, 2026 05:56
@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