Skip to content

chore: enhanced ownership semantics in flux storage layer - #27592

Draft
gwossum wants to merge 1 commit into
main-2.xfrom
gw/27590/flux_storage_enhanced_ownership
Draft

gwossum wants to merge 1 commit into
main-2.xfrom
gw/27590/flux_storage_enhanced_ownership

Conversation

@gwossum

@gwossum gwossum commented Aug 18, 2026

Copy link
Copy Markdown
Member

Continue the enhanced ownership semantics in the flux storage layer that were introduced with #27573. In contrast to those changes, these changes have no practical user-visible changes. Under rare circumstances the max query memory for failed flux queries may be slightly smaller than in previous versions.

The buffer-ownership model introduced in #27573 is now carried across all abandoment paths, including error rejection and panic. Every Arrow buffer now has exactly one releaser on every exit.

Closes: #27590

Continue the enhanced ownership semantics in the flux storage layer that
were introduced with #27573. In contrast to those changes, these changes
have no practical user-visible changes. Under rare circumstances the max
query memory for failed flux queries may be slightly smaller than in
previous versions.

The buffer-ownership model introduced in #27573 is now carried across
all abandoment paths, including error rejection and panic. Every Arrow
buffer now has exactly one releaser on every exit.

Closes: #27590
@gwossum gwossum self-assigned this Aug 18, 2026
@gwossum gwossum added kind/bug area/flux Issues related to the Flux query engine kind/tech-debt Needs cleanup, will make the developer experience better area/2.x OSS 2.0 related issues and PRs team/edge labels Aug 18, 2026
@gwossum
gwossum requested a balanced review from Copilot August 18, 2026 22:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Extends Flux storage buffer ownership cleanup across cancellation, rejection, and panic paths.

Changes:

  • Adds exactly-once buffer release semantics.
  • Cleans up rejected metadata tables.
  • Expands allocator, panic, and concurrency tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
storage/flux/window.go Releases window-row buffers on more exits.
storage/flux/window_cancel_test.go Expands window ownership tests.
storage/flux/table.go Centralizes table buffer release.
storage/flux/table_release_test.go Tests table release and concurrency paths.
storage/flux/reader.go Cleans up rejected metadata tables.
storage/flux/reader_metadata_release_test.go Tests metadata table cleanup.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread storage/flux/table.go
Comment on lines +145 to +148
// error return below, a panic unwinding out of f, and a panic out of
// advance after it installed a fresh buffer. It runs before closeDone
// (LIFO), so done never closes with the buffer still retained.
defer t.releaseColBufs()
Comment thread storage/flux/reader.go
Comment on lines +923 to +924
if err := f(tbl); err != nil {
tbl.Done()
Comment thread storage/flux/window.go
Comment on lines 98 to 104
if err := f(table); err != nil {
// Same abandonment as the cancellation case below: an erroring
// callback has not queued the table for a consumer, so nobody
// else will release the buffer.
table.abandon(done)
return err
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/flux Issues related to the Flux query engine area/2.x OSS 2.0 related issues and PRs kind/bug kind/tech-debt Needs cleanup, will make the developer experience better team/edge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants