New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KAFKA-9171: Handle ReplicaNotAvailableException during DelayedFetch #7678
KAFKA-9171: Handle ReplicaNotAvailableException during DelayedFetch #7678
Conversation
@@ -139,6 +140,9 @@ class DelayedFetch(delayMs: Long, | |||
case _: NotLeaderForPartitionException => // Case A | |||
debug("Broker is no longer the leader of %s, satisfy %s immediately".format(topicPartition, fetchMetadata)) | |||
return forceComplete() | |||
case _: ReplicaNotAvailableException => // Case H | |||
debug("Broker no longer has a replica of %s, satisfy %s immediately".format(topicPartition, fetchMetadata)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use string interpolation? We do it for 3 of the other cases, but not the one immediately above. Also, should this be case B
and shift the rest instead of case H
? It seems like it would be easier to understand if the first 3 cases were about leader/replica/partition knowledge. Also, we could have the case checks in order: A, B, C, etc.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ijuma Thanks for the review, updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just to double check, none of the exceptions in the catch block is a subclass of another exception in the same catch block, right? This ensures ordering is irrelevant.
@ijuma Thanks for the review. Have confirmed that none of the exceptions in the catch block are subclasses of another exception in the catch block. |
@ijuma Thanks for the review, merging to trunk and 2.4. |
…7678) Reviewers: Ismael Juma <ismael@juma.me.uk>
Committer Checklist (excluded from commit message)