# How to delete an unassigned primary shard

**URL:** https://discuss.elastic.co/t/how-to-delete-an-unassigned-primary-shard/355446
**Category:** Elasticsearch
**Tags:** ilm-index-lifecycle-management
**Created:** [March 15, 2024, 2:45am UTC](https://discuss.elastic.co/t/how-to-delete-an-unassigned-primary-shard/355446 "2024-03-15T02:45:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Churchill](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/churchill/32/131677_2.png) [@Churchill](https://discuss.elastic.co/u/Churchill)
#### Post date: [March 15, 2024, 2:45am UTC](https://discuss.elastic.co/t/how-to-delete-an-unassigned-primary-shard/355446/1 "2024-03-15T02:45:20Z")

</div>

Good day,

We're currently experiencing an issue with one of our index (let's call it sample\_index) which has 21 primary shards with 1 replica. The primary shards of sample\_index are distributed on all our nodes. Unfortunately, one of our node's disk crashed yesterday, and needs to be replaced. This made the primary shard of sample\_index on that crashed node to be an unassigned primary shard, probably because it failed to be relocated due to the crash. This is causing our cluster in red state. I checked all other nodes, i can still see a primary shard of sample\_index intact.

How can I delete the unassigned primary shard w/o affecting the primay shard of sample\_index on other working nodes?

Here's the result when I ran allocation explain:

`curl -XGET http://localhost:9200/_cluster/allocation/explain?pretty`

```auto
  "index" : "sample_index",
  "shard" : 5,
  "primary" : true,
  "current_state" : "unassigned",
  "unassigned_info" : {
    "reason" : "NODE_LEFT",
    "at" : "2024-03-14T13:30:11.936Z",
    "details" : "node_left [HcOL6RzKQRegH4vwLg60jg]",
    "last_allocation_status" : "no_valid_shard_copy"
  },
  "can_allocate" : "no_valid_shard_copy",
  "allocate_explanation" : "cannot allocate because all found copies of the shard are either stale or corrupt",
  "node_allocation_decisions" : [
    {
      "node_id" : "DugpqTy2T2mWAGCaj24gsw",
      "node_name" : "inca-platform-es-nodes-001",
      "transport_address" : "10.3.0.101:9300",
      "node_attributes" : {
        "xpack.installed" : "true",
        "transform.node" : "false"
      },
      "node_decision" : "no",
      "store" : {
        "found" : false
      }
    }

```

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 15, 2024, 3:50am UTC](https://discuss.elastic.co/t/how-to-delete-an-unassigned-primary-shard/355446/2 "2024-03-15T03:50:46Z")

</div>

But you said you have 1 replica right?  
Why the replica is not promoted as primary?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [April 12, 2024, 3:51am UTC](https://discuss.elastic.co/t/how-to-delete-an-unassigned-primary-shard/355446/3 "2024-04-12T03:51:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
