[ 
https://issues.apache.org/jira/browse/KAFKA-19022?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17938509#comment-17938509
 ] 

Lorcan commented on KAFKA-19022:
--------------------------------

Upon further investigation and reading the file FetchResponse.json, which is 
used to generate the code for FetchResponseData, it looks like a [Kafka 
Improvement 
Proposal|https://cwiki.apache.org/confluence/display/kafka/kafka+improvement+proposals#KafkaImprovementProposals-Whatisconsidereda%22majorchange%22thatneedsaKIP?]
 would be needed.

> Display cluster IDs being compared when encountering INCONSISTENT_CLUSTER_ID 
> error
> ----------------------------------------------------------------------------------
>
>                 Key: KAFKA-19022
>                 URL: https://issues.apache.org/jira/browse/KAFKA-19022
>             Project: Kafka
>          Issue Type: Improvement
>          Components: kraft, logging
>    Affects Versions: 3.9.0
>            Reporter: Ranganath Samudrala
>            Assignee: Lorcan
>            Priority: Major
>
> While migrating Kafka from zookeeper to kraft, we see errors in logs like
> {{INCONSISTENT_CLUSTER_ID in FETCH response }}
> or
> {{INCONSISTENT_CLUSTER_ID in VOTER response }}
> But cluster IDs being compared is not displayed in logs so there is not 
> enough information to see where the issue is. Is the class data *clusterId* 
> empty (which could potentially be a bug?) or incoming *clusterId* empty or 
> incorrect?
> [KafkaRaftClient|https://github.com/apache/kafka/blob/31e1a57c41cf9cb600751669dc71bcd9596b45f9/raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java#L1459]
> {code:java}
>     private boolean hasValidClusterId(String requestClusterId) {
>         // We don't enforce the cluster id if it is not provided.
>         if (requestClusterId == null)Unknown macro: {
>                       return true;
>                  }
>                 return clusterId.equals(requestClusterId);
>      }
> .
> .
>     private CompletableFuture<FetchResponseData> handleFetchRequest(
>         RaftRequest.Inbound requestMetadata,
>         long currentTimeMs
>     ) {
>         FetchRequestData request = (FetchRequestData) requestMetadata.data();
>         if (!hasValidClusterId(request.clusterId())) {
>                      return completedFuture(new 
> FetchResponseData().setErrorCode(Errors.INCONSISTENT_CLUSTER_ID.code()));
>                  }
> .
> .
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to