Skip to content

[flink] Fix source split reader release reliability#8183

Open
QuakeWang wants to merge 1 commit into
apache:masterfrom
QuakeWang:cdc-reader-reliability
Open

[flink] Fix source split reader release reliability#8183
QuakeWang wants to merge 1 commit into
apache:masterfrom
QuakeWang:cdc-reader-reliability

Conversation

@QuakeWang

Copy link
Copy Markdown
Contributor

Purpose

The source split readers keep a single pooled iterator and may also hold currentFirstBatch after seeking past restored records.

The old design had two reliability gaps:

  • close() only closed the lazy record reader, so an already fetched currentFirstBatch could be left unreleased.
  • releaseBatch() returned the pooled iterator only after the underlying batch release succeeded. If iterator.releaseBatch() threw, the single-entry pool lost its iterator and later fetches could block forever.

This PR releases currentFirstBatch during close, always returns the pooled iterator in a finally block, and aligns the CDC reader's no-split fetch path with the common reader by failing clearly instead of returning without a valid split.

Tests

  • mvn -pl paimon-flink/paimon-flink-common -am -Pfast-build -DfailIfNoTests=false -Dtest=FileStoreSourceSplitReaderTest test
  • mvn -pl paimon-flink/paimon-flink-cdc -am -Pfast-build -DfailIfNoTests=false -Dtest=CDCSourceSplitReaderTest test

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