{
  "id": "elasticsearch/transient-cluster-routing-error",
  "signature": "ElasticsearchException: failed to reroute after shard allocation",
  "signature_zh": "Elasticsearch异常：分片分配后路由重试失败",
  "regex": "ElasticsearchException: failed to reroute after shard allocation",
  "domain": "elasticsearch",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A transient cluster routing failure occurred when the master node attempted to reassign shards after a node join or leave, often due to a stale cluster state or network partition.",
  "root_cause_type": "generic",
  "root_cause_zh": "当主节点在节点加入或离开后尝试重新分配分片时发生的临时集群路由故障，通常由于过时的集群状态或网络分区引起。",
  "versions": [
    {
      "version": "7.17.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.11.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.12.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Restart does not resolve stale cluster state or network issues; the master will reattempt the same failed reroute.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Manual reroute bypasses cluster state validation, potentially causing duplicate shard copies or lost primary shards.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Higher concurrency may amplify the impact of stale routing decisions, leading to more failed reroute attempts.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Force a cluster state update by temporarily disabling shard allocation, then re-enabling it: `PUT _cluster/settings {\"transient\": {\"cluster.routing.allocation.enable\": \"none\"}}` wait 30 seconds, then `PUT _cluster/settings {\"transient\": {\"cluster.routing.allocation.enable\": \"all\"}}`.",
      "success_rate": 0.8,
      "how": "Force a cluster state update by temporarily disabling shard allocation, then re-enabling it: `PUT _cluster/settings {\"transient\": {\"cluster.routing.allocation.enable\": \"none\"}}` wait 30 seconds, then `PUT _cluster/settings {\"transient\": {\"cluster.routing.allocation.enable\": \"all\"}}`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Clear the stale cluster state by running `POST /_cluster/reroute?retry_failed=true` to retry failed allocation commands.",
      "success_rate": 0.7,
      "how": "Clear the stale cluster state by running `POST /_cluster/reroute?retry_failed=true` to retry failed allocation commands.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the error persists, take a snapshot of the cluster state with `POST /_snapshot/repo/backup` and then restart the master node with `--cluster.routing.allocation.disk.threshold_enabled=false` to bypass disk checks temporarily.",
      "success_rate": 0.75,
      "how": "If the error persists, take a snapshot of the cluster state with `POST /_snapshot/repo/backup` and then restart the master node with `--cluster.routing.allocation.disk.threshold_enabled=false` to bypass disk checks temporarily.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Force a cluster state update by temporarily disabling shard allocation, then re-enabling it: `PUT _cluster/settings {\"transient\": {\"cluster.routing.allocation.enable\": \"none\"}}` wait 30 seconds, then `PUT _cluster/settings {\"transient\": {\"cluster.routing.allocation.enable\": \"all\"}}`.",
    "Clear the stale cluster state by running `POST /_cluster/reroute?retry_failed=true` to retry failed allocation commands.",
    "If the error persists, take a snapshot of the cluster state with `POST /_snapshot/repo/backup` and then restart the master node with `--cluster.routing.allocation.disk.threshold_enabled=false` to bypass disk checks temporarily."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.75,
  "resolvable": "partial",
  "first_seen": "2024-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}