Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings are not validated when snapshot restore is performed #37485

Open
andrershov opened this issue Jan 15, 2019 · 3 comments
Open

Settings are not validated when snapshot restore is performed #37485

andrershov opened this issue Jan 15, 2019 · 3 comments
Labels
>bug :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Team:Distributed Meta label for distributed team

Comments

@andrershov
Copy link
Contributor

When snapshot restore is performed, setting Validator is not executed. So even if the setting does not pass validation, snapshot restore will succeed.
The easiest way to reproduce the issue is to inject dummy setting by installing Plugin during the test and break this setting validation before snapshot restore.

@andrershov andrershov added >bug :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs labels Jan 15, 2019
@andrershov andrershov self-assigned this Jan 15, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

andrershov added a commit that referenced this issue Jan 16, 2019
All tests except testRestorePersistentSettings (renamed to
testExceptionWhenRestoringPersistentSettings) worked fine.
testExceptionWhenRestoringPersistentSettings re-written to use a custom
setting, because "minimum master node" setting is no longer available
in Zen2. It turns out there is no good replacement for "minimum master
node" setting for this test, that's why the custom setting is
introduced.

Unfortunately, there is #37485 bug and currently
RestoreService does not perform setting validation. That's why the
test is annotated with @AwaitsFix, the idea is to merge this commit and
then fix the issue and enable the test. (The test passes with a simple
fix, that adds a single line to RestoreService).
@DaveCTurner
Copy link
Contributor

DaveCTurner commented Jan 10, 2020

Copied from #50837: there is a different but related issue about the validation of the index settings supplied by the user when restoring a snapshot too:

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.

@rjernst rjernst added the Team:Distributed Meta label for distributed team label May 4, 2020
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Team:Distributed Meta label for distributed team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants