hachikuji commented on a change in pull request #9553:
URL: https://github.com/apache/kafka/pull/9553#discussion_r547548831
##########
File path: raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java
##########
@@ -1037,6 +1047,35 @@ private boolean handleFetchResponse(
logger.info("Truncated to offset {} from Fetch response
from leader {}",
truncationOffset, quorum.leaderIdOrNil());
});
+ } else if (partitionResponse.snapshotId().epoch() >= 0 ||
+ partitionResponse.snapshotId().endOffset() >= 0) {
+ // The leader is asking us to fetch a snapshot
+
+ if (partitionResponse.snapshotId().epoch() < 0) {
+ throw new KafkaException(
Review comment:
Hmm.. I would rather not handle this case specially by transitioning to
a candidate. It's not a crazy idea, but I think we should attempt that in a
separate PR and consider errors more holistically.
I would suggest that we log an error saying that the remote replica seemed
to return an invalid response and just keep fetching. Then a user can see the
log message and restart the remote replica.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]