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

Don't load global state when only restoring indices #28934

Closed
ywelsch opened this issue Mar 8, 2018 · 2 comments
Closed

Don't load global state when only restoring indices #28934

ywelsch opened this issue Mar 8, 2018 · 2 comments
Labels
:Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >enhancement

Comments

@ywelsch
Copy link
Contributor

ywelsch commented Mar 8, 2018

Restoring from a snapshot currently also always loads the global state (templates, customs, ...) even though it's not always used by the restore process, for example when include_global_state is set to false in the restore request. In case there are version incompatibilities in the global state file, or corruption issues, this prevents indices from being restored. We could instead simply not load the global state when it's not required for the restore process.

/cc: @elastic/es-distributed

@ywelsch ywelsch added discuss :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs labels Mar 8, 2018
@bleskes
Copy link
Contributor

bleskes commented Mar 8, 2018

Seems logical to me. @tlrx , any opinions?

@tlrx
Copy link
Member

tlrx commented Mar 8, 2018

We could instead simply not load the global state when it's not required for the restore process.

It makes sense to me. I think that we can have the same issue when deleting a snapshot but I'm not sure we can avoid loading the global state in this case. I'll take a look.

@tlrx tlrx added >enhancement and removed discuss labels Mar 8, 2018
@hub-cap hub-cap added :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs and removed :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs labels Mar 9, 2018
tlrx added a commit to tlrx/elasticsearch that referenced this issue Mar 25, 2018
Restoring a snapshot, or getting the status of finished
snapshots, currently always load the global state metadata
 file from the repository even if it not required. This
slows down the restore process (or listing statuses process)
 and can also be an issue if the global state cannot be
deserialized (because it has unknown customs for example).

This commit splits the Repository.getSnapshotMetadata()
method into two distincts methods: getGlobalMetadata()
and getIndexMetadata() that are now called on purpose.

Closes elastic#28934
tlrx added a commit to tlrx/elasticsearch that referenced this issue Mar 28, 2018
When deleting a snapshot, it is not necessary to load and to parse the
global metadata of the snapshot to delete. Now indices are stored in
the snapshot metadata file, we have all the information to resolve the
shards files to delete.

This commit removes the readSnapshotMetaData() method that was used to
load both global and index metadata files. Test coverage should be
enough as SharedClusterSnapshotRestoreIT already contains several
deletion tests.

Related to elastic#28934
tlrx added a commit that referenced this issue Mar 29, 2018
When deleting a snapshot, it is not necessary to load and to parse the
global metadata of the snapshot to delete. Now indices are stored in
the snapshot metadata file, we have all the information to resolve the
shards files to delete.

This commit removes the readSnapshotMetaData() method that was used to
load both global and index metadata files. Test coverage should be
enough as SharedClusterSnapshotRestoreIT already contains several
deletion tests.

Related to #28934
tlrx added a commit that referenced this issue May 3, 2018
When deleting a snapshot, it is not necessary to load and to parse the
global metadata of the snapshot to delete. Now indices are stored in
the snapshot metadata file, we have all the information to resolve the
shards files to delete.

This commit removes the readSnapshotMetaData() method that was used to
load both global and index metadata files. Test coverage should be
enough as SharedClusterSnapshotRestoreIT already contains several
deletion tests.

Related to #28934
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >enhancement
Projects
None yet
Development

No branches or pull requests

4 participants