{
  "id": "elasticsearch/primary-shard-not-allocated-due-to-node-version-mismatch",
  "signature": "PrimaryShardNotAllocatedException: primary shard [my_index][0] not allocated because node version [7.10.2] is incompatible with index version [7.17.0]",
  "signature_zh": "主分片未分配异常：主分片 [my_index][0] 未分配，因为节点版本 [7.10.2] 与索引版本 [7.17.0] 不兼容",
  "regex": "PrimaryShardNotAllocatedException: primary shard \\[.*\\] not allocated because node version \\[.*\\] is incompatible with index version \\[.*\\]",
  "domain": "elasticsearch",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "A node with an older Elasticsearch version cannot host a primary shard created by a newer version due to Lucene segment format incompatibility.",
  "root_cause_type": "generic",
  "root_cause_zh": "较旧版本的 Elasticsearch 节点无法托管由较新版本创建的主分片，因为 Lucene 段格式不兼容。",
  "versions": [
    {
      "version": "7.10.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "7.17.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "8.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Node version does not change on restart; manual upgrade is required.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Data is lost and the root cause (version mismatch) remains if other nodes are still newer.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Upgrade the older node's Elasticsearch version to match the index version (e.g., from 7.10.2 to 7.17.0) using rolling upgrade: `sudo systemctl stop elasticsearch`, replace package, restart, and wait for shard allocation.",
      "success_rate": 0.9,
      "how": "Upgrade the older node's Elasticsearch version to match the index version (e.g., from 7.10.2 to 7.17.0) using rolling upgrade: `sudo systemctl stop elasticsearch`, replace package, restart, and wait for shard allocation.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reindex the data to a new index with compatible settings: `POST _reindex { \"source\": { \"index\": \"my_index\" }, \"dest\": { \"index\": \"my_index_v2\" } }` then delete old index and use alias.",
      "success_rate": 0.8,
      "how": "Reindex the data to a new index with compatible settings: `POST _reindex { \"source\": { \"index\": \"my_index\" }, \"dest\": { \"index\": \"my_index_v2\" } }` then delete old index and use alias.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Upgrade the older node's Elasticsearch version to match the index version (e.g., from 7.10.2 to 7.17.0) using rolling upgrade: `sudo systemctl stop elasticsearch`, replace package, restart, and wait for shard allocation.",
    "Reindex the data to a new index with compatible settings: `POST _reindex { \"source\": { \"index\": \"my_index\" }, \"dest\": { \"index\": \"my_index_v2\" } }` then delete old index and use alias."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.elastic.co/guide/en/elasticsearch/reference/7.17/rolling-upgrades.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}