divijvaidya commented on code in PR #12224:
URL: https://github.com/apache/kafka/pull/12224#discussion_r892065895


##########
metadata/src/test/java/org/apache/kafka/metalog/LocalLogManager.java:
##########
@@ -227,14 +228,14 @@ synchronized long tryAppend(int nodeId, int epoch, 
List<ApiMessageAndVersion> ba
 
         synchronized long tryAppend(int nodeId, int epoch, LocalBatch batch) {
             if (epoch != leader.epoch()) {
-                log.trace("tryAppend(nodeId={}, epoch={}): the provided epoch 
does not " +
+                log.debug("tryAppend(nodeId={}, epoch={}): the provided epoch 
does not " +
                     "match the current leader epoch of {}.", nodeId, epoch, 
leader.epoch());
-                return Long.MAX_VALUE;
+                throw new NotLeaderException("Append failed because the 
replication is not the current leader");

Review Comment:
   Thanks for pointing this out. I have updated LocalLogManager to adhere to 
the same.



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