Andrew Grant created KAFKA-20023:
------------------------------------

             Summary: Fix kafka-reassign-partitions.sh to handle dead brokers 
                 Key: KAFKA-20023
                 URL: https://issues.apache.org/jira/browse/KAFKA-20023
             Project: Kafka
          Issue Type: Bug
            Reporter: Andrew Grant


In https://issues.apache.org/jira/browse/KAFKA-19582 we added code to print the 
log directories of the replicas in the current assignment. But if the current 
assignment contains a dead broker, then the command will fail including when 
running with --execute. The error you will see is
{code:java}
Error: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a 
node assignment. Call: describeReplicaLogDirs
java.util.concurrent.ExecutionException: 
org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node 
assignment. Call: describeReplicaLogDirs
        at 
java.base/java.util.concurrent.CompletableFuture.wrapInExecutionException(CompletableFuture.java:347)
        at 
java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:442)
        at 
java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2119)
        at 
org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:155)
        at 
org.apache.kafka.tools.reassign.ReassignPartitionsCommand.getReplicaToLogDir(ReassignPartitionsCommand.java:1689)
        at 
org.apache.kafka.tools.reassign.ReassignPartitionsCommand.currentPartitionReplicaAssignmentToString(ReassignPartitionsCommand.java:1076)
        at 
org.apache.kafka.tools.reassign.ReassignPartitionsCommand.executeAssignment(ReassignPartitionsCommand.java:920)
        at 
org.apache.kafka.tools.reassign.ReassignPartitionsCommand.handleAction(ReassignPartitionsCommand.java:197)
        at 
org.apache.kafka.tools.reassign.ReassignPartitionsCommand.main(ReassignPartitionsCommand.java:166)
Caused by: org.apache.kafka.common.errors.TimeoutException: Timed out waiting 
for a node assignment. Call: describeReplicaLogDirs {code}
This is problematic since kafka-reassign-partitions.sh often is used precisely 
for moving partitions away from dead brokers.



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

Reply via email to