Skip to content

Keep detached rows visible through Parquet publication - #58

Merged
VibeSWE merged 4 commits into
mainfrom
fix/staging-conversion-visibility
Oct 21, 2026
Merged

VibeSWE merged 4 commits into
mainfrom
fix/staging-conversion-visibility

Conversation

@VibeSWE

@VibeSWE VibeSWE commented Oct 21, 2026 •

Copy link
Copy Markdown

A query between writer detachment and Parquet publication can omit rows that were already accepted. Retain detached writers' Arrow buffers until their corresponding Parquet is published, and capture memory plus local Parquet membership under the same publication lock. Rows remain visible exactly once across that local transition, including failed conversion and retry.

This extends the current-writer retention from merged PR #53 to detached writers. Physical part files are exclusively created with collision fallback. Startup recovery skips attached writers, coordinates with detachment/sealing, and transfers or discards retained-memory ownership along with the source file. Encoding and query execution remain outside the publication lock; Arrow payloads are shared.

Validation includes publication barriers, failed conversion and retry, late appends after failed sealing, overlapping detaches, and same-instance startup recovery. The three recovery regressions were run before the fix and all failed with the expected retained-memory duplication or stale rows. Fresh independent Sol review approved the recovery fix. After integrating #57, the writer, stream and query-provider suites passed: 86 passed, 1 ignored. A new combined publication/lease regression also passes, including ten independent reruns: it pauses publication, captures memory plus real file leases, deletes the original Parquet and verifies exact row IDs and lease cleanup. Fresh Sol and Opus reviews approved the integration; Opus also approved the corrected parallel test barriers.

Limits are documented in docs/staging-conversion-visibility.md: memory staging must be enabled; failed sealing/conversion retains buffers until recovery and can increase RAM usage. PR50's broader recovery/converter ownership work remains separate. Staged-file lifetime and overlap with uploaded copies are addressed in #57. This does not establish an atomic snapshot spanning memory and remote manifests. This branch includes merged #57 and takes its file leases inside capture_staging, before refreshing the remote snapshot. Capture-time cleanup and footer validation also run under the publication read lock and can delay publication on slow filesystems.

This backend fix is separate from the merged Prism UI retirement in #55. The branch includes current main, including #53, #55 and #56, and includes the now-merged #57. This PR targets main.

Comment thread src/parseable/streams.rs
@VibeSWE
VibeSWE changed the base branch from fix/current-minute-query-visibility to main October 21, 2026 17:41
@VibeSWE
VibeSWE changed the base branch from main to t3/staged-parquet-lifetime-race October 21, 2026 17:57
@VibeSWE
VibeSWE changed the base branch from t3/staged-parquet-lifetime-race to main October 21, 2026 18:06
@VibeSWE
VibeSWE merged commit 63e9b5e into main Oct 21, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant