tchivs created FLINK-41010:
------------------------------
Summary: [cdc-base] NPE in HybridSplitAssigner.createStreamSplit
when failed snapshot splits are re-added after assigner finished
Key: FLINK-41010
URL: https://issues.apache.org/jira/browse/FLINK-41010
Project: Flink
Issue Type: Bug
Components: Flink CDC
Affects Versions: cdc-3.7.0, cdc-3.6.0
Reporter: tchivs
FLINK-40052 reports this for MySQL. The incremental snapshot framework in
flink-cdc-base (used by Postgres, Oracle, SQL Server, Db2) has the same defect,
and the open PR for FLINK-40052 only changes the MySQL assigner.
With parallelism 1, {{SnapshotSplitAssigner#onFinishedSplits}} moves the status
to {{INITIAL_ASSIGNING_FINISHED}} as soon as the last split reports. If the
reader then fails and the split comes back through {{addSplits}}, the status is
not rolled back, {{noMoreSplits()}} returns true, and
{{HybridSplitAssigner#createStreamSplit}} dereferences the missing finished
offset ({{HybridSplitAssigner.java:316}} on master). The state is checkpointed,
so restarting the job hits the same NPE.
Suggested fix: in {{SnapshotSplitAssigner#addSplits}}, roll
{{INITIAL_ASSIGNING_FINISHED}} back to {{INITIAL_ASSIGNING}} (and
{{NEWLY_ADDED_ASSIGNING_SNAPSHOT_FINISHED}} back to {{NEWLY_ADDED_ASSIGNING}})
and clear {{checkpointIdToFinish}}, mirroring the MySQL fix.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)