kafka runtime_error ai_generated true

org.apache.kafka.common.errors.ReassignmentInProgressException: No reassignment in progress for partition my_topic-0

ID: kafka/no-reassignment-in-progress

Also available as: JSON · Markdown · 中文
88%Fix Rate
84%Confidence
1Evidence
2024-03-10First Seen

Root Cause

Admin client attempted to cancel or alter a partition reassignment that does not exist or has already completed, due to stale metadata or incorrect partition identifier.

generic

中文

管理客户端尝试取消或修改一个不存在或已完成的重新分配,原因是元数据过期或分区标识符错误。

Official Documentation

https://kafka.apache.org/documentation/#adminclient_reassignpartitions

Workarounds

  1. 95% success First, verify the current reassignment status using `kafka-reassign-partitions.sh --bootstrap-server localhost:9092 --verify --reassignment-json-file reassign.json`. If completed, no further action needed.
    First, verify the current reassignment status using `kafka-reassign-partitions.sh --bootstrap-server localhost:9092 --verify --reassignment-json-file reassign.json`. If completed, no further action needed.
  2. 85% success If the reassignment never started due to a previous error, re-submit the reassignment JSON using `kafka-reassign-partitions.sh --execute` with the correct partition list.
    If the reassignment never started due to a previous error, re-submit the reassignment JSON using `kafka-reassign-partitions.sh --execute` with the correct partition list.
  3. 90% success Use the AdminClient API: `adminClient.listPartitionReassignments().all().get()` to check active reassignments before attempting cancel. Example Java code: `ListPartitionReassignmentsResult result = adminClient.listPartitionReassignments();`
    Use the AdminClient API: `adminClient.listPartitionReassignments().all().get()` to check active reassignments before attempting cancel. Example Java code: `ListPartitionReassignmentsResult result = adminClient.listPartitionReassignments();`

中文步骤

  1. First, verify the current reassignment status using `kafka-reassign-partitions.sh --bootstrap-server localhost:9092 --verify --reassignment-json-file reassign.json`. If completed, no further action needed.
  2. If the reassignment never started due to a previous error, re-submit the reassignment JSON using `kafka-reassign-partitions.sh --execute` with the correct partition list.
  3. Use the AdminClient API: `adminClient.listPartitionReassignments().all().get()` to check active reassignments before attempting cancel. Example Java code: `ListPartitionReassignmentsResult result = adminClient.listPartitionReassignments();`

Dead Ends

Common approaches that don't work:

  1. 90% fail

    If the reassignment is already complete, retrying the same cancel will always fail because there is no in-progress reassignment.

  2. 70% fail

    In modern Kafka (2.6+), reassignments are tracked via the 'reassign_partitions' topic; deleting ZK nodes is ineffective and may cause corruption.

  3. 80% fail

    Restarting a broker does not affect the reassignment state; the admin client will still see no in-progress reassignment.