# AdminCommandFailedException: 分区重新分配失败，因为没有可行的候选节点

- **ID:** `kafka/partition-reassignment-failed-no-candidates`
- **领域:** kafka
- **类别:** system_error
- **验证级别:** ai_generated
- **修复率:** 70%

## 根因

分区重新分配算法无法找到任何满足指定约束条件（如机架感知、资源限制）的代理。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Kafka 3.2.0 | active | — | — |
| Kafka 3.5.0 | active | — | — |
| Kafka 3.7.0 | active | — | — |

## 解决方案

1. ```
   Add more brokers to the cluster or free up resources on existing brokers (e.g., delete unused topics, increase disk space). Then retry the reassignment with a balanced plan.
   ```
2. ```
   Use the `--generate` option in `kafka-reassign-partitions.sh` to create a reassignment plan that respects current constraints, then execute it with `--execute`.
   ```

## 无效尝试

- **Forcing reassignment with `--force` flag without adjusting constraints** — The `--force` flag does not bypass viability checks; it only skips some safety checks, and the algorithm still fails. (90% 失败率)
- **Manually specifying a broker that is already at full disk capacity** — The broker cannot accept more partitions due to resource limits, and the reassignment will fail or degrade cluster performance. (85% 失败率)
