slachiewicz opened a new pull request, #347:
URL: https://github.com/apache/flink-connector-kafka/pull/347
## What is the purpose of the change
Since FLINK-39888, `KafkaSource`, `DynamicKafkaSource` and both Kafka table
sources reject `auto.offset.reset=by_duration:<duration>` (KIP-1106,
kafka-clients 4.0+), because the configured value is matched against the
deprecated `OffsetResetStrategy` enum. A job with this property, which the
consumer itself accepts, fails at startup on upgrade. 5.0 did not fail, but
only because it overwrote the value.
## Brief change log
- `KafkaPropertiesUtil.normalizeAutoOffsetReset` validates values outside
the enum with the consumer's own validator (`ConsumerConfig.configDef()`) and
passes them through unchanged. `earliest`, `latest` and `none` keep the
case-insensitive normalization to lower case.
- The builders, the dynamic source's reader and enumerator, and the table
option check use it. `by_duration` never counts as opposing a positional
initializer.
- With `group-offsets`, both table sources start from `committedOffsets()`
when the configured strategy is not an enum value; the value stays in the
consumer properties.
- The rejection message now lists the validator's values, including
`by_duration`.
## Verifying this change
This change added tests and can be verified as follows:
- `KafkaPropertiesUtilTest`: normalization, `by_duration` pass-through,
values the consumer rejects, and `by_duration` never opposing an initializer
- `KafkaSourceBuilderTest`, `DynamicKafkaSourceBuilderTest`,
`DynamicKafkaTableFactoryTest` and `KafkaDynamicTableFactoryTest` (every
startup mode) accept `by_duration:PT1H` and keep it; these fail on `main` with
the error from the ticket
## Does this pull request potentially affect one of the following parts:
- Dependencies: no
- The public API: no
- Checkpointed state, its serializers, or exactly-once delivery: no
- The per-record code paths: 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? not applicable
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
Generated-by: Claude Code (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]