showuon opened a new pull request, #12589:
URL: https://github.com/apache/kafka/pull/12589

   …sting API error
   
   When writeEvent failed, we'll try to renounce the controller state. But if 
the error is an `ApiException`, we'll just throw exception. The problem 
happened when trying to allocate buffer for the batch, we might encounter 
`RecordBatchTooLargeException`. The RecordBatchTooLargeException thrown from 
BatchAccumulator#append is one of ApiException, and that will enter 
[here](https://github.com/apache/kafka/blob/trunk/metadata/src/main/java/org/apache/kafka/controller/QuorumController.java#L446)
 without `renounce`. 
   
   Fix it by creating new `RaftBatchTooLargeException` since this exception 
thrown by `BatchAccumulator` should be part of RaftException, not ApiException.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to