andrewgrantcflt commented on code in PR #23245:
URL: https://github.com/apache/kafka/pull/23245#discussion_r3854739823


##########
metadata/src/main/java/org/apache/kafka/controller/ReplicationControlManager.java:
##########
@@ -1562,7 +1583,7 @@ void handleDirectoriesCordoned(
 
     ControllerResult<ElectLeadersResponseData> 
electLeaders(ElectLeadersRequestData request) {
         ElectionType electionType = electionType(request.electionType());
-        List<ApiMessageAndVersion> records = 
BoundedList.newArrayBacked(MAX_RECORDS_PER_USER_OP);
+        List<ApiMessageAndVersion> records = 
BoundedList.newArrayBacked(maxRecordsPerBatch);

Review Comment:
   I'm not too sure. I do see the following:
   
https://github.com/apache/kafka/blob/trunk/metadata/src/main/java/org/apache/kafka/controller/errors/EventHandlerExceptionInfo.java#L83-L88
   ```
           } else if (internal instanceof BoundedListTooLongException) {
               // The operation could not be performed because it would have 
created an overly large
               // batch.
               return new EventHandlerExceptionInfo(false, false, internal,
                   new PolicyViolationException("Unable to perform excessively 
large batch " +
                       "operation."));
   ```
   I think `BoundedListTooLongException` does eventually get mapped to the same 
exception, albeit with a different error message. I probably would have made 
the code that throws `BoundedListTooLongException` catch it and re-throw a 
`PolicyViolationException` directly but that's probably out of scope for this 
PR.



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