Skip to content

fix: release the Coordinator segment response in sys.segments - #20523

Open
kgyrtkirk wants to merge 1 commit into
apache:masterfrom
kgyrtkirk:sys-segments-response-release
Open

kgyrtkirk wants to merge 1 commit into
apache:masterfrom
kgyrtkirk:sys-segments-response-release

Conversation

@kgyrtkirk

@kgyrtkirk kgyrtkirk commented Oct 8, 2026 •

Copy link
Copy Markdown
Member
  • fixes to places where the closeable was not closed due to various reasons
    • these close calls will lead to the coordinator client to shut down - and release the buffer
  • uses ResourceHolder instead CloseableIterator

note: recommend to enable ignore whitespace while viewing the changes

needs #202521 to be present for a test which is failing right now to pass

fetchAllUsedSegmentsWithOvershadowedStatus hands out a ResourceHolder that closes the streamed response; MetadataSegmentView and SystemSchema close it, also on early exit, and QueryHandler now closes the bound Interpreter so scans under Filter/Project nodes are released too. No segment left behind.

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🟢 Approval recommended

No actionable issues found. The response holder closes both the lazy JSON iterator and its underlying input stream, including when closed before the first read. Metadata polling closes the holder on successful and failed iteration, uncached scans carry ownership through datasource filtering, and sys.segments propagates early close through its enumerable. The bound interpreter is released on completion, early exit, and enumeration failure.

Reviewed 12 of 12 changed files, including production changes, regression tests, benchmark and embedded-client adaptations, plus relevant callers, sequence cleanup, and Calcite 1.42.0 iterator/interpreter implementations.

Validation: git diff --check 3e93651 aff397e passed. Static review only; tests and builds were not run.


This is an automated review by Codex GPT-5.6-Luna(max)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants