-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Fix Needless Warnings when Restoring over Closed Index #75912
Fix Needless Warnings when Restoring over Closed Index #75912
Conversation
We're trying to delete each file twice and will always warn on the second non-suppressing delete method when there's files to delete.
Pinging @elastic/es-distributed (Team:Distributed) |
@@ -188,12 +188,12 @@ private void afterRestore(SnapshotFiles snapshotFiles, Store store, StoreFileMet | |||
|
|||
/// now, go over and clean files that are in the store, but were not in the snapshot | |||
try { | |||
store.deleteQuiet("restore"); |
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.
I couldn't find any usage of a "restore" file and this seems to be dead code to me, but maybe I'm missing something?
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 right to me, the deletion of this file was added way back in 59d9f7e but it's not obvious why.
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 like dead code to me too, so +1 on removing
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, I noted a related comment bug (same bug in two comments)
@@ -188,12 +188,12 @@ private void afterRestore(SnapshotFiles snapshotFiles, Store store, StoreFileMet | |||
|
|||
/// now, go over and clean files that are in the store, but were not in the snapshot | |||
try { | |||
store.deleteQuiet("restore"); |
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 right to me, the deletion of this file was added way back in 59d9f7e but it's not obvious why.
@@ -188,12 +188,12 @@ private void afterRestore(SnapshotFiles snapshotFiles, Store store, StoreFileMet | |||
|
|||
/// now, go over and clean files that are in the store, but were not in the snapshot | |||
try { | |||
store.deleteQuiet("restore"); | |||
for (String storeFile : store.directory().listAll()) { | |||
if (Store.isAutogenerated(storeFile) || snapshotFiles.containPhysicalIndexFile(storeFile)) { | |||
continue; // skip write.lock, checksum files and files that exist in the snapshot |
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.
continue; // skip write.lock, checksum files and files that exist in the snapshot | |
continue; // skip write.lock and files that exist in the snapshot |
"checksum files" are not a thing any more (since 5.0?); the javadoc on Store#isAutogenerated
has the same cruft as this.
…ngs-restore-over-existing-closed-index
Jenkins run elasticsearch-ci/docs |
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 2 - I did not find anything about a "restore" file
Thanks David + Tanguy! |
We're trying to delete each file twice and will always warn on the second non-suppressing delete method when there's files to delete.
We're trying to delete each file twice and will always warn on the second non-suppressing
delete method when there's files to delete.