Skip to content

[GLUTEN-12468][FLINK] Handle WatermarkStatus elements in GlutenSourceFunction#12461

Open
lgbo-ustc wants to merge 11 commits into
apache:mainfrom
bigo-sg:feature/idle-source-handling
Open

[GLUTEN-12468][FLINK] Handle WatermarkStatus elements in GlutenSourceFunction#12461
lgbo-ustc wants to merge 11 commits into
apache:mainfrom
bigo-sg:feature/idle-source-handling

Conversation

@lgbo-ustc

@lgbo-ustc lgbo-ustc commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

Add processing for WatermarkStatus elements from native idle detection. When IDLE is received, call sourceContext.markAsTemporarilyIdle() to notify Flink that this source is temporarily idle, allowing watermark progress to continue from other sources.

Related PRs:

closed: #12468

How was this patch tested?

UTs

Was this patch authored or co-authored using generative AI tooling?

Generated-by: deepseek v4 pro

@lgbo-ustc lgbo-ustc changed the title [WIP][FLINK] Handle WatermarkStatus elements in GlutenSourceFunction [GLUTEN-12468][FLINK] Handle WatermarkStatus elements in GlutenSourceFunction Jul 7, 2026
@lgbo-ustc lgbo-ustc marked this pull request as ready for review July 7, 2026 09:11
@lgbo-ustc lgbo-ustc requested a review from KevinyhZou July 7, 2026 09:28
Add processing for WatermarkStatus elements from native idle detection.
When IDLE is received, call sourceContext.markAsTemporarilyIdle() to notify
Flink that this source is temporarily idle, allowing watermark progress to
continue from other sources.
Adds GlutenSourceFunctionWatermarkStatusTest with 5 test cases covering:
- IDLE status triggers markAsTemporarilyIdle()
- ACTIVE status is a no-op on SourceContext
- IDLE→ACTIVE transition does not call markAsTemporarilyIdle()
- Repeated IDLE calls are idempotent
- ACTIVE status produces no invocations

Uses reflection to invoke private processWatermarkStatus() and a custom
TrackingSourceContext spy — no Mockito or native session required.
…uster

- Add GlutenStreamSource.isShouldCallNoMoreSplits() delegating to source
- Add GlutenSourceFunction.isShouldCallNoMoreSplits() getter
- Extend OffloadedJobGraphGenerator to preserve shouldCallNoMoreSplits
  when creating a new GlutenSourceFunction during offloading
- Rewrite GlutenSourceFunctionWatermarkStatusE2ETest as a real E2E test
  using embedded Kafka broker + Flink MiniCluster, verifying that
  WatermarkStatus.IDLE is emitted after idle timeout
- Fix EmptyNode output type in WatermarkPushDownSpec project to match
  table scan schema (avoids FieldNotFound error during plan init)
Covered by GlutenSourceFunctionWatermarkStatusE2ETest which tests
the same behavior end-to-end with Kafka + MiniCluster.
Add testIdleInputExcludedFromMinWatermark to
GlutenStreamTwoInputWatermarkStatusTest: when one input is marked
IDLE, its watermark is excluded from min-watermark calculation so
the other active input can advance freely.
@lgbo-ustc lgbo-ustc force-pushed the feature/idle-source-handling branch from 3342506 to 9cd1b66 Compare July 13, 2026 02:13
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.

[FLINK] Implement idle source handling for watermark status propagation

1 participant