[FLINK-39429][cdc-base] Avoid shaded Guava in incremental source fetchers#4462
Open
qiuyanjun888 wants to merge 1 commit into
Open
[FLINK-39429][cdc-base] Avoid shaded Guava in incremental source fetchers#4462qiuyanjun888 wants to merge 1 commit into
qiuyanjun888 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
flink-cdc-baseincremental source fetcher paths.ThreadFactoryBuilderusage with a small JDK-only daemon thread factory.Lists.partitionusage with a local JDK-only partition helper.Root Cause
FLINK-39429 reports
NoClassDefFoundErrorfororg/apache/flink/shaded/guava31/...when running CDC with Flink 2.2. Theflink-cdc-baseproduction classes referenced Flink's shaded Guava 31 package directly, but that package is not available in the reported runtime environment.Fix
ThreadFactoryimplementations in:IncrementalSourceStreamFetcherIncrementalSourceScanFetcherSnapshotSplitAssignerpartition(...)helper inIncrementalSourceEnumerator.IncrementalSourceFetcherDependencyTestto prevent shaded Guava 31 references from returning inflink-cdc-baseproduction classes.Validation
mvn -pl flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base -am -Pflink2 -Dtest=IncrementalSourceFetcherDependencyTest -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -DskipITs -Dcheckstyle.skip -Drat.skip=true -Dspotless.check.skip=true -Dmdep.skip=true testmvn -pl flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base -am -Pflink2 -Dtest='!SplitKeyUtilsTest,!FinishedSnapshotSplitInfoTest' -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false -DskipITs -Dcheckstyle.skip -Drat.skip=true -Dspotless.check.skip=true -Dmdep.skip=true testmvn -pl flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base -am -Pflink2 -DskipTests -Drat.skip=true -Dmdep.skip=true verifyNote: the broader module test command excludes two known Java 17 Mockito blocker tests (
SplitKeyUtilsTest,FinishedSnapshotSplitInfoTest) that are unrelated to this change.Jira
https://issues.apache.org/jira/browse/FLINK-39429
Reviewers
cc @leonardBang @haruki-830 — you recently reviewed/authored changes touching this area.
AI Assistance Disclosure
This PR was prepared with AI-assisted tooling and manually validated with the commands above.