shwncho opened a new pull request, #354:
URL: https://github.com/apache/flink-connector-kafka/pull/354

   ## What is the purpose of the change
   
   When a topic is removed from the subscription of a `KafkaSource` and the job 
is restored from a checkpoint or savepoint, the readers restore the splits of 
the removed topic and keep reading it. Partition discovery only logs 
`Discovered removed partitions`, and the topic integrity check (FLINK-40128) 
only checks the subscribed topics. The Kafka connector docs don't mention this, 
and it has been reported several times (FLINK-30490, FLINK-32266, FLINK-34089). 
This pull request documents the behaviour and the workaround.
   
   ## Brief change log
   
     - Add a "Removing Topics from the Subscription" section to 
`docs/content/docs/connectors/datastream/kafka.md`, after "Topic Integrity 
Check". It covers:
       - restored splits of removed topics, patterns, and partitions are still 
read
       - changing the source `uid` and restarting with 
`--allow-non-restored-state`, which drops the offsets of all splits of the 
source
       - continuing from committed offsets with 
`OffsetsInitializer.committedOffsets()`
       - the Dynamic Kafka connector, which filters restored splits against its 
current metadata
     - Add the same section to `docs/content.zh`
   
   ## Verifying this change
   
   This change is a documentation-only change without any test coverage.
   
   The described behaviour matches 
`KafkaSourceEnumerator#handlePartitionSplitChanges` (removed partitions are not 
handled), `TopicIntegrityProvider` (only subscribed topics are checked), and 
`DynamicKafkaSourceReader` (restored splits are filtered by 
`isSplitForActiveClusters`). We also hit it in production with connector 
`5.0.0-2.2`.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency, including 
`kafka.version` or `flink.version`): no
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)` or `@Experimental`, or are the Table options or the PyFlink 
wrappers changed: no
     - Checkpointed state, its serializers, or exactly-once delivery (splits, 
enumerator state, writer state, committables, transactions): no
     - The per-record code paths (split reader, record emitter, writer, 
serialization schemas; performance sensitive): no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable
     - If the docs changed, are both `docs/content` and `docs/content.zh` 
updated? yes
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code 2.1.323 (Claude Opus 5.5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to