Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Opensearch 2.19.0
Describe the issue:
We’ve encountered a snapshot restore issue and would appreciate your insights or confirmation on expected behavior.
Steps to Reproduce:
- Took a snapshot of an index
test-indexwithnumber_of_shards = 1. - Deleted the
test-indexindex. - Recreated the
test-indexindex with same name but with different shard countnumber_of_shards = 5. - Attempted to restore the snapshot taken in Step 1.
Result:
The restore failed with the following error:
[snapshot_restore_exception]: cannot restore index [test-index] with [5] shards from a snapshot of index [test-index] with [1] shards
It seems the mismatch in shard count between the snapshot and the existing index is causing the issue.
Configuration:
PUT test-index
{
“mappings”: {},
“settings”: {
“number_of_shards”: 5,
“number_of_replicas”: 1
}
}
Question:
Is it expected that the snapshot restore fails if the target index has a different number of shards than the original snapshot?
Is there a recommended way to restore a snapshot to an index with a different shard configuration?