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


##########
metadata/src/main/java/org/apache/kafka/controller/ConfigurationControlManager.java:
##########
@@ -378,9 +379,8 @@ private ApiError validateAlterConfig(
                 return INVALID_CORDONED_LOG_DIRS_ERROR;
             } else if (configRecord.value() == null) {
                 allConfigs.remove(configRecord.name());
-            } else if (configRecord.value().length() > Short.MAX_VALUE) {
-                // In KRaft mode, large config values cannot be created by 
appending.
-                // If the size exceeds Short.MAX_VALUE, this error will be 
thrown to notify the user.
+            } else if 
(configRecord.value().getBytes(StandardCharsets.UTF_8).length > 
Short.MAX_VALUE) {

Review Comment:
   Would you mind using `Utils#utf8Length` instead?



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