-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Describe the bug
When an index with index sorting is being restored an error happens preventing it from being restored. It seems to be only happening for indices with sorting defined, the indices without it doesn't seem to be affected. In addition trying to restore with the index.sort.field and index.sort.order added to ignore_index_settings doesn't change the situation.
OpenSearch accepts the restore command and returns:
{"accepted":true}
But in the logs we can see:
[2025-11-21T15:42:59,154][WARN ][o.o.c.r.a.AllocationService] [xarea.local] failing shard [failed shard, shard [test][0], node[I7HYk4sKTm2Hm7i__wxf2g], [P], recovery_source[snapshot recovery [rxwlTnTXSo-1UHY43a9M9g] from test-fs-repository:1/1jJfc8QJQxSFRMgnopbSfg], s[INITIALIZING], a[id=r2OwMITXR1OK8RHlpXm7Tw], unassigned_info[[reason=ALLOCATION_FAILED], at[2025-11-21T14:42:59.102Z], failed_attempts[4], failed_nodes[[I7HYk4sKTm2Hm7i__wxf2g]], delayed=false, details[failed shard on node [I7HYk4sKTm2Hm7i__wxf2g]: failed recovery, failure RecoveryFailedException[[test][0]: Recovery failed on {xarea.local}{I7HYk4sKTm2Hm7i__wxf2g}{1MF4EKFlToqU9LouSSAKUQ}{127.0.0.1}{127.0.0.1:9300}{dimr}{shard_indexing_pressure_enabled=true}]; nested: IndexShardRecoveryException[failed recovery]; nested: IndexShardRestoreFailedException[restore failed]; nested: IndexShardRestoreFailedException[failed to restore snapshot [1/1jJfc8QJQxSFRMgnopbSfg]]; nested: IllegalArgumentException[can't add field [__nested_parent] as parent document field; this IndexWriter has no parent document field configured]; ], allocation_status[fetching_shard_data]], expected_shard_size[4304], message [failed recovery], failure [RecoveryFailedException[[test][0]: Recovery failed on {xarea.local}{I7HYk4sKTm2Hm7i__wxf2g}{1MF4EKFlToqU9LouSSAKUQ}{127.0.0.1}{127.0.0.1:9300}{dimr}{shard_indexing_pressure_enabled=true}]; nested: IndexShardRecoveryException[failed recovery]; nested: IndexShardRestoreFailedException[restore failed]; nested: IndexShardRestoreFailedException[failed to restore snapshot [1/1jJfc8QJQxSFRMgnopbSfg]]; nested: IllegalArgumentException[can't add field [__nested_parent] as parent document field; this IndexWriter has no parent document field configured]; ], markAsStale [true]]
org.opensearch.indices.recovery.RecoveryFailedException: [test][0]: Recovery failed on {xarea.local}{I7HYk4sKTm2Hm7i__wxf2g}{1MF4EKFlToqU9LouSSAKUQ}{127.0.0.1}{127.0.0.1:9300}{dimr}{shard_indexing_pressure_enabled=true}
at org.opensearch.index.shard.IndexShard.lambda$executeRecovery$1(IndexShard.java:4132) ~[opensearch-3.3.2.jar:3.3.2]
at org.opensearch.core.action.ActionListener$1.onFailure(ActionListener.java:90) ~[opensearch-core-3.3.2.jar:3.3.2]
at org.opensearch.index.shard.StoreRecovery.lambda$recoveryListener$1(StoreRecovery.java:639) ~[opensearch-3.3.2.jar:3.3.2]
at org.opensearch.core.action.ActionListener$1.onFailure(ActionListener.java:90) ~[opensearch-core-3.3.2.jar:3.3.2]
at org.opensearch.index.shard.StoreRecovery.lambda$restore$1(StoreRecovery.java:918) ~[opensearch-3.3.2.jar:3.3.2]
at org.opensearch.core.action.ActionListener$1.onFailure(ActionListener.java:90) ~[opensearch-core-3.3.2.jar:3.3.2]
at org.opensearch.repositories.blobstore.BlobStoreRepository.lambda$restoreShard$0(BlobStoreRepository.java:4172) ~[opensearch-3.3.2.jar:3.3.2]
at org.opensearch.core.action.ActionListener$2.onFailure(ActionListener.java:113) ~[opensearch-core-3.3.2.jar:3.3.2]
at org.opensearch.core.action.ActionListener$1.onFailure(ActionListener.java:90) ~[opensearch-core-3.3.2.jar:3.3.2]
at org.opensearch.core.action.ActionListener$1.onResponse(ActionListener.java:84) ~[opensearch-core-3.3.2.jar:3.3.2]
at org.opensearch.repositories.blobstore.BlobStoreRepository$10.restoreFiles(BlobStoreRepository.java:4190) ~[opensearch-3.3.2.jar:3.3.2]
at org.opensearch.repositories.blobstore.FileRestoreContext.restore(FileRestoreContext.java:182) ~[opensearch-3.3.2.jar:3.3.2]
at org.opensearch.repositories.blobstore.BlobStoreRepository.lambda$restoreShard$1(BlobStoreRepository.java:4291) ~[opensearch-3.3.2.jar:3.3.2]
at org.opensearch.action.ActionRunnable$2.doRun(ActionRunnable.java:89) ~[opensearch-3.3.2.jar:3.3.2]
at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:975) ~[opensearch-3.3.2.jar:3.3.2]
at org.opensearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:52) ~[opensearch-3.3.2.jar:3.3.2]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: org.opensearch.index.shard.IndexShardRecoveryException: failed recovery
... 17 more
Caused by: org.opensearch.index.snapshots.IndexShardRestoreFailedException: restore failed
... 15 more
Caused by: org.opensearch.index.snapshots.IndexShardRestoreFailedException: failed to restore snapshot [1/1jJfc8QJQxSFRMgnopbSfg]
... 13 more
Caused by: java.lang.IllegalArgumentException: can't add field [__nested_parent] as parent document field; this IndexWriter has no parent document field configured
at org.apache.lucene.index.FieldInfos$FieldNumbers.verifyParentFieldName(FieldInfos.java:489) ~[lucene-core-10.3.1.jar:10.3.1 51190f35a16d2ce433139abfe0fd8365791b352a - 2025-10-02 09:50:16]
at org.apache.lucene.index.FieldInfos$FieldNumbers.addOrGet(FieldInfos.java:420) ~[lucene-core-10.3.1.jar:10.3.1 51190f35a16d2ce433139abfe0fd8365791b352a - 2025-10-02 09:50:16]
at org.apache.lucene.index.IndexWriter.getFieldNumberMap(IndexWriter.java:1280) ~[lucene-core-10.3.1.jar:10.3.1 51190f35a16d2ce433139abfe0fd8365791b352a - 2025-10-02 09:50:16]
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1127) ~[lucene-core-10.3.1.jar:10.3.1 51190f35a16d2ce433139abfe0fd8365791b352a - 2025-10-02 09:50:16]
at org.opensearch.common.lucene.Lucene.pruneUnreferencedFiles(Lucene.java:231) ~[opensearch-3.3.2.jar:3.3.2]
at org.opensearch.repositories.blobstore.FileRestoreContext.afterRestore(FileRestoreContext.java:208) ~[opensearch-3.3.2.jar:3.3.2]
at org.opensearch.repositories.blobstore.FileRestoreContext.lambda$restore$0(FileRestoreContext.java:185) ~[opensearch-3.3.2.jar:3.3.2]
at org.opensearch.core.action.ActionListener$1.onResponse(ActionListener.java:82) ~[opensearch-core-3.3.2.jar:3.3.2]
Related component
Storage:Snapshots
To Reproduce
- Create a new snapshot repository
curl -XPUT -H 'Content-type: application/json' 'http://localhost:9200/_snapshot/test-fs-repository' -d '{
"type": "fs",
"settings": {
"location": "/tmp/snapshots"
}
}'
- Setup test index:
curl -XPUT -H 'Content-type: application/json' 'http://localhost:9200/test' -d '{
"settings": {
"index": {
"sort.field": "timestamp",
"sort.order": "desc"
}
},
"mappings": {
"properties": {
"name": {
"type": "text"
},
"timestamp": {
"type": "date"
}
}
}
}'
- Index test document:
curl -XPOST -H 'Content-type: application/json' 'http://localhost:9200/test/_doc/1' -d '{
"name": "Test document",
"timestamp": "2025-11-21T15:40:00Z"
}'
- Create a snapshot:
curl -XPUT -H 'Content-type: application/json' 'http://localhost:9200/_snapshot/test-fs-repository/1'
- Delete the original index:
curl -XDELETE 'http://localhost:9200/test'
- Try to restore the index:
curl -XPOST 'http://localhost:9200/_snapshot/test-fs-repository/1/_restore'
It results in the error described in the ticket description.
Expected behavior
The expected behavior is that the index is restored successfully.
Additional Details
Plugins
Clean OpenSearch installation, no additional plugins.
Screenshots
No screenshot.
Host/Environment (please complete the following information):
- OS: MacOS 26.1
- Version 3.3.2
Additional context
No additional context.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status