Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-13741

Cluster IDs should not have leading dash

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.1.0, 3.0.0
    • 3.2.0
    • kraft

    Description

      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:

      ./bin/kafka-storage.sh format --config ./config/kraft/controller.properties \
          --cluster-id -Xflm1nKSfOK8QGt_AXhxw
      

      This will not parse correctly as the argument parsing library will treat the cluster ID as an argument. It leads to the following error:

      usage: kafka-storage format [-h] --config CONFIG --cluster-id CLUSTER_ID [--ignore-formatted]
      kafka-storage: error: argument --cluster-id/-t: expected one argument
      

      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.

      Attachments

        Issue Links

          Activity

            People

              mumrah David Arthur
              mumrah David Arthur
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: