You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "David Arthur (Jira)" <ji...@apache.org> on 2022/04/04 23:18:00 UTC

[jira] [Resolved] (KAFKA-13741) Cluster IDs should not have leading dash

     [ https://issues.apache.org/jira/browse/KAFKA-13741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Arthur resolved KAFKA-13741.
----------------------------------
    Resolution: Fixed

> Cluster IDs should not have leading dash
> ----------------------------------------
>
>                 Key: KAFKA-13741
>                 URL: https://issues.apache.org/jira/browse/KAFKA-13741
>             Project: Kafka
>          Issue Type: Bug
>          Components: kraft
>    Affects Versions: 3.1.0, 3.0.0
>            Reporter: David Arthur
>            Assignee: David Arthur
>            Priority: Minor
>              Labels: kip-500
>             Fix For: 3.2.0
>
>
> Since we use URL-safe base64 encoded Uuid's for cluster ID, it is possible for dash ("-") characters to be present in the ID string. When a cluster ID has a leading dash, we can run into problems when running the Kafka bash scripts.
> For example, if the ID "-Xflm1nKSfOK8QGt_AXhxw" is generated with "random-uuid" sub-command of kafka-storage.sh, we would then normally format the log directories like:
> {code}
> ./bin/kafka-storage.sh format --config ./config/kraft/controller.properties \
>     --cluster-id -Xflm1nKSfOK8QGt_AXhxw
> {code}
> This will not parse correctly as the argument parsing library will treat the cluster ID as an argument. It leads to the following error:
> {code}
> usage: kafka-storage format [-h] --config CONFIG --cluster-id CLUSTER_ID [--ignore-formatted]
> kafka-storage: error: argument --cluster-id/-t: expected one argument
> {code}
> This can be worked around by putting the ID in quotes, or by using an "=" between the "--cluster-id" and the Uuid.
> We can solve this going forward by not generating random Uuid's that contain a leading dash.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)