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

Fix Needless Warnings when Restoring over Closed Index #75912

Conversation

original-brownbear
Copy link
Member

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.
@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Aug 1, 2021
@elasticmachine
Copy link
Collaborator

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");
Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Member

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

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, 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");
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.

@original-brownbear
Copy link
Member Author

Jenkins run elasticsearch-ci/docs

Copy link
Member

@tlrx tlrx left a 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

@original-brownbear
Copy link
Member Author

Thanks David + Tanguy!

@original-brownbear original-brownbear merged commit 6d99735 into elastic:master Aug 2, 2021
@original-brownbear original-brownbear deleted the fix-spurious-warnings-restore-over-existing-closed-index branch August 2, 2021 09:51
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Aug 2, 2021
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.
original-brownbear added a commit that referenced this pull request Aug 15, 2021
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.
@original-brownbear original-brownbear restored the fix-spurious-warnings-restore-over-existing-closed-index branch April 18, 2023 20:50
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.15.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants