chia7712 commented on code in PR #22384:
URL: https://github.com/apache/kafka/pull/22384#discussion_r3379769424


##########
metadata/src/main/java/org/apache/kafka/metadata/storage/Formatter.java:
##########
@@ -236,6 +236,17 @@ public void run() throws Exception {
         if (clusterId == null) {
             throw new FormatterException("You must specify the cluster id.");
         }
+        try {
+            if (clusterId.contains("=")) {
+                throw new FormatterException("The specified cluster id, " + 
clusterId + " contains padding and is invalid");

Review Comment:
   If we care about the equality, should we simply verify it via the `toString` 
instead? For example:
   
   ```java
   Uuid uuid = Uuid.fromString(clusterId);
   if (!clusterId.equals(uuid.toString())) {
       throw new FormatterException("Invalid cluster id format");
   }
   ```



-- 
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