Skip to content

Conversation

@loserwang1024
Copy link
Contributor

@loserwang1024 loserwang1024 commented Oct 24, 2025

What is the purpose of the change

As shown in https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=373886480, add a new source contract that enables the enumerator to have a complete global view of splits.

Brief change log

Extending FLIP-27, this FLIP modified ReaderRegistrationEvent Contract:

If a Source implements SupportsSplitReassignmentOnRecovery, the SourceOperator does not assigned splits from state to the reader. Instead, it reports the splits via a ReaderRegistrationEvent sent to the SplitEnumerator.If a Source is not implements SupportsSplitReassignmentOnRecovery, the SourceOperator assigned splits from state to the reader.The splits won't be included in ReaderRegistrationEvent.

After the SourceCoordinator receives the ReaderRegistrationEvent, it calls addReader on the SplitEnumerator. At this point, the enumerator can access the reported splits through the ReaderInfo obtained from SplitEnumeratorContext#registeredReaders.

Verifying this change

  • SourceCoordinatorTest#testDuplicateRedistribution
  • SourceOperatorTest#testOpen

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): yes
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? JavaDocs

@flinkbot
Copy link
Collaborator

flinkbot commented Oct 24, 2025

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@loserwang1024
Copy link
Contributor Author

@leonardBang @ruanhang1993 ,CC

@loserwang1024
Copy link
Contributor Author

@flinkbot run azure

@leonardBang leonardBang self-requested a review October 29, 2025 09:23
Copy link
Contributor

@leonardBang leonardBang left a comment

Choose a reason for hiding this comment

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

Thanks @loserwang1024 for the contribution, I left some comments

this.successfulCheckpoints = new ArrayList<>();
this.started = false;
this.closed = false;
calculateAndPutPendingAssignments(unassignedSplits);
Copy link
Contributor

Choose a reason for hiding this comment

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

reassignSplits(unassignedSplits) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe recalculateAssignments? Don't assign them until the split is added.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@loserwang1024
Copy link
Contributor Author

@leonardBang Thanks for your review. Just modify it.


/**
* A decorative interface for {@link Source}. Implementing this interface indicates that the source
* operator needs to report splits to the enumerator and receive reassignment.
Copy link
Contributor

Choose a reason for hiding this comment

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

needs to report splits to the enumerator on start up and receive reassignment on recovery?

<rules>
<requireMavenVersion>
<version>[3.8.6]</version>
<version>3.8.6</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

plz revert this

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.

3 participants