You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Martijn Visser (Jira)" <ji...@apache.org> on 2022/12/16 10:40:00 UTC

[jira] [Commented] (FLINK-30434) The non-null check for transactionalIdPrefix is unnecessary in the KafkaWriter constructor

    [ https://issues.apache.org/jira/browse/FLINK-30434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17648559#comment-17648559 ] 

Martijn Visser commented on FLINK-30434:
----------------------------------------

This code is checking if the delivery guarantee is set to EXACTLY_ONCE and *only then* throws an error if a transactionalIdPrefix isn't set. I don't see why that is wrong?

> The non-null check for transactionalIdPrefix is unnecessary in the KafkaWriter constructor
> ------------------------------------------------------------------------------------------
>
>                 Key: FLINK-30434
>                 URL: https://issues.apache.org/jira/browse/FLINK-30434
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / Kafka
>    Affects Versions: 1.16.0, 1.14.6, 1.15.3
>            Reporter: Zhengqi Zhang
>            Priority: Major
>         Attachments: image-2022-12-16-18-24-14-706.png
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> The non-null check for transactionalIdPrefix is unnecessary in the KafkaWriter constructor, especially when EXACTLY_ONCE semantics are not used.
> First, when EXACTLY_ONCE semantics are used, a non-null check has been performed for transactionalIdPrefix in KafkaSinkBuilder.
> Secondly, although the default value "kafka-sink" has been assigned to transactionalIdPrefix in KafkaSinkBuilder, if the user uses the setTransactionalIdPrefix method to set it to null, the construction method of KafkaWriter will throw an exception, even if the user does not use EXACTLY_ONCE semantics at this time.
> Obviously, we should allow transactionalIdPrefix to be null when EXACTLY_ONCE semantics are not used.
> !image-2022-12-16-18-24-14-706.png|width=692,height=461!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)