Elasticsearch: Index settings should be validated when restoring a snapshot

Created on 10 Jan 2020  路  5Comments  路  Source: elastic/elasticsearch

Today one can apply index settings when restoring a snapshot, but we are rather lenient about the settings that we accept:

POST /_snapshot/backing_repo/snap/_restore
{
  "index_settings": {
    "index.setting.misspelled": "blah",
    "index.frozen": true
  }
}
# 200 OK
# {
#   "accepted": true
# }

GET _settings
# 200 OK
# {
#   "original": {
#     "settings": {
#       "index": {
#         "provided_name": "original",
#         "frozen": "true",  // 馃挜 this setting is PrivateIndex
#         "number_of_shards": "1",
#         "uuid": "M5thzFiuTf6x-4_Fc82lMg",
#         "number_of_replicas": "0",
#         "version": {
#           "created": "8000099"
#         },
#         "creation_date": "1578592744159"
#       },
#       "archived": {
#         "index": {
#           "setting": {
#             "misspelled": "blah"  // 馃挜 this setting is unknown
#           }
#         }
#       }
#     }
#   }
# }

Ideally either of these settings should have caused the restore to fail.

:DistributeSnapshoRestore >bug

All 5 comments

Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore)

@DaveCTurner I guess this is a sub-problem/duplicate of https://github.com/elastic/elasticsearch/issues/37485 ?

I think it's different (but related). #37485 refers to settings coming from the index metadata we read from the repository (which may include PrivateIndex settings I guess) whereas this issue is about settings coming directly from the user at restore-time (which must not include PrivateIndex settings).

Can we fold this into the other issue as a one-stop place for setting validation for snap/restore?

Ok, I copied the details into the other issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

clintongormley picture clintongormley  路  3Comments

makeyang picture makeyang  路  3Comments

dadoonet picture dadoonet  路  3Comments

rjernst picture rjernst  路  3Comments

abtpst picture abtpst  路  3Comments