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.
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.