jsancio commented on a change in pull request #11116:
URL: https://github.com/apache/kafka/pull/11116#discussion_r679475174
##########
File path:
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java
##########
@@ -580,12 +580,17 @@ public void run() throws Exception {
// written before we can return our result to the user. Here,
we hand off
// the batch of records to the raft client. They will be
written out
// asynchronously.
- final long offset;
+ final Long offset;
if (result.isAtomic()) {
offset = raftClient.scheduleAtomicAppend(controllerEpoch,
result.records());
} else {
offset = raftClient.scheduleAppend(controllerEpoch,
result.records());
}
+ if (offset == null) {
+ throw new IllegalStateException("The raft client was
unable to allocate a buffer for an append");
+ } else if (offset == Long.MAX_VALUE) {
+ throw new IllegalStateException("Unable to append records
since this is not the leader");
+ }
Review comment:
This is a partial fix until we merge
https://github.com/apache/kafka/pull/10909
--
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]