You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/01/14 04:08:45 UTC

[GitHub] [kafka] showuon opened a new pull request #9885: MINOR: replace NotLeaderForPartitionException with NotLeaderOrFollowerException

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


   The `NotLeaderForPartitionException` is deprecated in 2.6 in this PR #8979. We should replace NotLeaderForPartitionException with `NotLeaderOrFollowerException`.
   
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### 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.

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



[GitHub] [kafka] ijuma commented on a change in pull request #9885: MINOR: replace NotLeaderForPartitionException with NotLeaderOrFollowerException

Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #9885:
URL: https://github.com/apache/kafka/pull/9885#discussion_r557038771



##########
File path: core/src/main/scala/kafka/server/KafkaApis.scala
##########
@@ -1068,13 +1068,14 @@ class KafkaApis(val requestChannel: RequestChannel,
             response
           } catch {
             // NOTE: These exceptions are special cases since these error messages are typically transient or the client
-            // would have received a clear exception and there is no value in logging the entire stack trace for the same
+            // would have received a clear exception.
             case e @ (_ : UnknownTopicOrPartitionException |
-                      _ : NotLeaderForPartitionException |
+                      _ : NotLeaderOrFollowerException |
                       _ : UnknownLeaderEpochException |
                       _ : FencedLeaderEpochException |
                       _ : KafkaStorageException |
                       _ : UnsupportedForMessageFormatException) =>
+              // print the stack trace for debugging
               e.printStackTrace()

Review comment:
       This doesn't make much sense, we should not be printing the stacktrace like this.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] showuon commented on pull request #9885: MINOR: replace NotLeaderForPartitionException with NotLeaderOrFollowerException

Posted by GitBox <gi...@apache.org>.
showuon commented on pull request #9885:
URL: https://github.com/apache/kafka/pull/9885#issuecomment-759957967


   @mimaison , I also removed the `e.printStackTrace()`. Please let me know if you mis-put this debugging line here. Thanks.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] mimaison commented on pull request #9885: MINOR: replace NotLeaderForPartitionException with NotLeaderOrFollowerException

Posted by GitBox <gi...@apache.org>.
mimaison commented on pull request #9885:
URL: https://github.com/apache/kafka/pull/9885#issuecomment-760159015


   Tests passed locally, merging to trunk


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] showuon commented on pull request #9885: MINOR: replace NotLeaderForPartitionException with NotLeaderOrFollowerException

Posted by GitBox <gi...@apache.org>.
showuon commented on pull request #9885:
URL: https://github.com/apache/kafka/pull/9885#issuecomment-759912886


   @mimaison , I think you mis-replaced the exception with the deprecated one. Could you confirm it and review this PR? Thank you.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] mimaison commented on pull request #9885: MINOR: replace NotLeaderForPartitionException with NotLeaderOrFollowerException

Posted by GitBox <gi...@apache.org>.
mimaison commented on pull request #9885:
URL: https://github.com/apache/kafka/pull/9885#issuecomment-760106919


   @showuon That's definitively a mistake, thanks for the PR


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] mimaison merged pull request #9885: MINOR: replace NotLeaderForPartitionException with NotLeaderOrFollowerException

Posted by GitBox <gi...@apache.org>.
mimaison merged pull request #9885:
URL: https://github.com/apache/kafka/pull/9885


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] showuon edited a comment on pull request #9885: MINOR: replace NotLeaderForPartitionException with NotLeaderOrFollowerException

Posted by GitBox <gi...@apache.org>.
showuon edited a comment on pull request #9885:
URL: https://github.com/apache/kafka/pull/9885#issuecomment-759912886


   @mimaison , I think you mis-replaced the exception with the deprecated one in #8295. Could you confirm it and review this PR? Thank you.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] showuon commented on a change in pull request #9885: MINOR: replace NotLeaderForPartitionException with NotLeaderOrFollowerException

Posted by GitBox <gi...@apache.org>.
showuon commented on a change in pull request #9885:
URL: https://github.com/apache/kafka/pull/9885#discussion_r557040890



##########
File path: core/src/main/scala/kafka/server/KafkaApis.scala
##########
@@ -1068,13 +1068,14 @@ class KafkaApis(val requestChannel: RequestChannel,
             response
           } catch {
             // NOTE: These exceptions are special cases since these error messages are typically transient or the client
-            // would have received a clear exception and there is no value in logging the entire stack trace for the same
+            // would have received a clear exception.
             case e @ (_ : UnknownTopicOrPartitionException |
-                      _ : NotLeaderForPartitionException |
+                      _ : NotLeaderOrFollowerException |
                       _ : UnknownLeaderEpochException |
                       _ : FencedLeaderEpochException |
                       _ : KafkaStorageException |
                       _ : UnsupportedForMessageFormatException) =>
+              // print the stack trace for debugging
               e.printStackTrace()

Review comment:
       I agree. But I'd like to confirm with @mimaison since he added it in #8295. Thanks.




----------------------------------------------------------------
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:
users@infra.apache.org