gaurav-narula commented on code in PR #22384:
URL: https://github.com/apache/kafka/pull/22384#discussion_r3323541536
##########
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");
+ }
+ Uuid uuid = Uuid.fromString(clusterId);
+ if (Uuid.RESERVED.contains(uuid)) {
+ throw new FormatterException("The specified cluster id, " +
clusterId + " is reserved");
+ }
Review Comment:
I think these are cosmetic improvement that's been added over time but have
no bearing on correctness. Failing validation on them would hinder migration
from older clusters where `-` was allowed.
The motivation for avoiding `-` in the beginning was to avoid shell escaping
issues when passing cluster id in CLI tools.
https://issues.apache.org/jira/browse/KAFKA-13741
Lately, https://issues.apache.org/jira/browse/KAFKA-20072 avoided `-`
altogether to allow easier copy-pasting.
--
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]