Can I replace a dead primary shard with the ok-replica?

I had a situation last night where a node left the cluster and I lost some primary shards. It rejoined, and the shards are showing up as UNASSIGNED with no documents:

  {
    "index": "my-index",
    "shard": "0",
    "prirep": "p",
    "state": "UNASSIGNED",
    "docs": null,
    "store": null,
    "ip": null,
    "node": null
  },

The replicas all look ok. I'm confident with the data in the replica shards. Can I replace the primaries with copies of the replica shards?

Thanks for any help!

If replica shard is in the cluster, elaticsearch will assign the shard as primary in a while. So there is no need to replace by youself. What GET /my-index/_recovery shows?

1 Like

It had been going on for hours overnight, so I'm assuming that recovery couldn't help. I ended up deleting the indexes this morning. Thanks, though! I'll check that endpoint if it happens again and see why the replacement doesn't happen.

1 Like

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