-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Clean existing index folder when loading searchable snapshot #60122
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
Conversation
|
Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore) |
DaveCTurner
left a comment
There was a problem hiding this 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.
...src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java
Outdated
Show resolved
Hide resolved
...src/test/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java
Show resolved
Hide resolved
| 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
DaveCTurner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@elasticmachine run elasticsearch-ci/1 |
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.
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.