kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject [kafka] branch trunk updated: MINOR: Include partition when logging fetch errors (#6206)
Date Sun, 10 Feb 2019 08:46:10 GMT
This is an automated email from the ASF dual-hosted git repository.

ijuma pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new c652842  MINOR: Include partition when logging fetch errors (#6206)
c652842 is described below

commit c6528424dfce22f18a6938f1bcc9409811719dc3
Author: Radai Rosenblatt <radai.rosenblatt@gmail.com>
AuthorDate: Sun Feb 10 00:45:58 2019 -0800

    MINOR: Include partition when logging fetch errors (#6206)
    
    This helps narrow down the specific broker they came from when debugging
    ACL propagation issues.
    
    Reviewers: Vahid Hashemian <vahid.hashemian@gmail.com>, Ismael Juma <ismael@juma.me.uk>
---
 .../java/org/apache/kafka/clients/consumer/internals/Fetcher.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java
b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java
index ccd749f..f41338e 100644
--- a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java
+++ b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java
@@ -990,12 +990,13 @@ public class Fetcher<K, V> implements SubscriptionState.Listener,
Closeable {
                     throw new OffsetOutOfRangeException(Collections.singletonMap(tp, fetchOffset));
                 }
             } else if (error == Errors.TOPIC_AUTHORIZATION_FAILED) {
-                log.warn("Not authorized to read from topic {}.", tp.topic());
+                //we log the actual partition and not just the topic to help with ACL propagation
issues in large clusters
+                log.warn("Not authorized to read from partition {}.", tp);
                 throw new TopicAuthorizationException(Collections.singleton(tp.topic()));
             } else if (error == Errors.UNKNOWN_SERVER_ERROR) {
                 log.warn("Unknown error fetching data for topic-partition {}", tp);
             } else {
-                throw new IllegalStateException("Unexpected error code " + error.code() +
" while fetching data");
+                throw new IllegalStateException("Unexpected error code " + error.code() +
" while fetching from partition " + tp);
             }
         } finally {
             if (partitionRecords == null)


Mime
View raw message