Repository navigation
Fix staged Parquet lifetime and upload overlap during queries - #57
Merged
Merged
Conversation
VibeSWE
commented
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Queries can select a staged Parquet file just before upload cleanup unlinks it, producing a missing-file error during execution. They can also select both the staged and uploaded copy. Capture same-filesystem hard links before refreshing the remote snapshot, retain them through native DataFusion plans and streams, and exclude staging copies already selected from the remote manifest.
The native Parquet reader, statistics and pushdowns remain in use. Shared validation preserves the uploader's corrupt/empty-file skip behavior; capture I/O errors fail explicitly. OS locks protect active leases and allow query capture to reclaim leases left by killed processes.
Validation: all 14
staging_leasetests pass, including an unleased-plan failure control, exact count/sum after original deletion, native repartitioning, stream lifetime/cancellation, setup failure rollback, and a separate-process kill/reclaim test. The broader query-provider suite also passes: 42 passed, 1 ignored. Fresh independent review approved the revised implementation. Formatting and diff checks pass.Tradeoffs and limits are documented in
docs/staging-query-leases.md: hard-link support is required; unique paths reduce footer-cache reuse; standalone staging-window scans add a metadata GET; Query/Prism snapshot errors now fail closed. A source disappearing before capture still produces an explicit error. Memory-to-Parquet publication and its existing overlap window require the separate conversion-visibility fix. This PR is independent of the Prism UI removal.Review follow-up: orphan reclamation is deferred until the next query capture, avoiding filesystem work under the global stream registry lock. The new regression failed before the fix and passes afterward. Deduplication assumes a stable partition layout; concurrent partition configuration changes remain a documented limitation.