Skip to content

Conversation

@ywelsch
Copy link
Contributor

@ywelsch ywelsch commented Jul 23, 2020

Closing a regular index and mounting a snapshot-backed index into that existing index does not clean the existing index folders of those preexisting shards.

This PR removes the existing Lucene / translog files once the searchable snapshot shard is starting up. Future PRs will make reuse of the existing index files to populate the cache.

@ywelsch ywelsch added >non-issue :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v8.0.0 v7.10.0 labels Jul 23, 2020
@ywelsch ywelsch marked this pull request as ready for review July 23, 2020 15:28
@elasticmachine
Copy link
Collaborator

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

@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Jul 23, 2020
@ywelsch ywelsch requested a review from DaveCTurner July 28, 2020 11:25
Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I left two tiny comments on the test.

@ywelsch ywelsch requested review from DaveCTurner and removed request for DaveCTurner July 28, 2020 16:23
final String indexName = randomAlphaOfLength(10).toLowerCase(Locale.ROOT);
final String aliasName = randomAlphaOfLength(10).toLowerCase(Locale.ROOT);
final String restoredIndexName = randomBoolean() ? indexName : randomAlphaOfLength(10).toLowerCase(Locale.ROOT);
final String restoredIndexName = true ? indexName : randomAlphaOfLength(10).toLowerCase(Locale.ROOT);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry another lost randomBoolean() here, and I'm guessing that deletedBeforeMount doesn't make sense if restoring into a different index name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've updated and fixed the test to take all situations properly into account. I've also left the deletedBeforeMount + different index name situation in there (just for completeness, even if it's not the most interesting scenario to test).

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ywelsch
Copy link
Contributor Author

ywelsch commented Jul 29, 2020

@elasticmachine run elasticsearch-ci/1

@ywelsch ywelsch merged commit 2c74688 into elastic:master Jul 29, 2020
ywelsch added a commit that referenced this pull request Aug 3, 2020
Closing a regular index and mounting a snapshot-backed index into that existing index does not clean the existing index
folders of those preexisting shards.

This PR removes the existing Lucene / translog files once the searchable snapshot shard is starting up. Future PRs will
make reuse of the existing index files to populate the cache.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >non-issue Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v7.10.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants