Skip to content

Conversation

@original-brownbear
Copy link
Contributor

If there's any file with the index- prefix but not a number after that at the repo root we must not throw here. If we do, we will end up throwing an unexpected exception that is not properly handled by org.elasticsearch.snapshots.SnapshotsService#failAllListenersOnMasterFailOver, leading to the repository generation not getting correctly set in the cluster state down the line.

Just like with other unexpected files in the repository, we should be able to deal with this one transparently.

… file If there's any file with the `index-` prefix but not a number after that at the repo root we must not throw here. If we do, we will end up throwing an unexpected exception that is not properly handled by `org.elasticsearch.snapshots.SnapshotsService#failAllListenersOnMasterFailOver`, leading to the repository generation not getting correctly set in the cluster state down the line.
@original-brownbear original-brownbear added >bug :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v8.8.0 labels Feb 20, 2023
@elasticsearchmachine elasticsearchmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Feb 20, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@elasticsearchmachine
Copy link
Collaborator

Hi @original-brownbear, I've created a changelog YAML for you.

return repositoryData.getGenId() > Long.parseLong(blob.substring(INDEX_FILE_PREFIX.length()));
} catch (NumberFormatException nfe) {
// odd case of an extra file with the index- prefix that we can't identify
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we log that we discovered unexpected file in repository?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm mildly worried this could get really spammy in some cases and we do already log this specific case in org.elasticsearch.repositories.blobstore.BlobStoreRepository#latestGeneration actually.
This is hopefully an edge case to the point where we won't have to worry much about it :)

Copy link
Contributor

@arteam arteam left a comment

Choose a reason for hiding this comment

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

LGTM2. @original-brownbear Does it make sense to backport the fix?

@original-brownbear
Copy link
Contributor Author

Thanks both + jup lets backport this :)

@original-brownbear original-brownbear merged commit 1b068aa into elastic:main Feb 20, 2023
@original-brownbear original-brownbear deleted the fix-bug-messy-index-file branch February 20, 2023 16:09
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Feb 20, 2023
… file (elastic#93914) If there's any file with the `index-` prefix but not a number after that at the repo root we must not throw here. If we do, we will end up throwing an unexpected exception that is not properly handled by `org.elasticsearch.snapshots.SnapshotsService#failAllListenersOnMasterFailOver`, leading to the repository generation not getting correctly set in the cluster state down the line.
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.7
7.17 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 93914

elasticsearchmachine pushed a commit that referenced this pull request Feb 20, 2023
… file (#93914) (#93942) If there's any file with the `index-` prefix but not a number after that at the repo root we must not throw here. If we do, we will end up throwing an unexpected exception that is not properly handled by `org.elasticsearch.snapshots.SnapshotsService#failAllListenersOnMasterFailOver`, leading to the repository generation not getting correctly set in the cluster state down the line.
carlosdelest pushed a commit to carlosdelest/elasticsearch that referenced this pull request Feb 21, 2023
… file (elastic#93914) If there's any file with the `index-` prefix but not a number after that at the repo root we must not throw here. If we do, we will end up throwing an unexpected exception that is not properly handled by `org.elasticsearch.snapshots.SnapshotsService#failAllListenersOnMasterFailOver`, leading to the repository generation not getting correctly set in the cluster state down the line.
@bpintea bpintea added v7.17.11 and removed v7.17.10 labels Apr 27, 2023
joegallo added a commit to joegallo/elasticsearch that referenced this pull request Jun 26, 2023
… file (elastic#93914) If there's any file with the `index-` prefix but not a number after that at the repo root we must not throw here. If we do, we will end up throwing an unexpected exception that is not properly handled by `org.elasticsearch.snapshots.SnapshotsService#failAllListenersOnMasterFailOver`, leading to the repository generation not getting correctly set in the cluster state down the line.
joegallo added a commit that referenced this pull request Jun 27, 2023
… file (#93914) (#97113) If there's any file with the `index-` prefix but not a number after that at the repo root we must not throw here. If we do, we will end up throwing an unexpected exception that is not properly handled by `org.elasticsearch.snapshots.SnapshotsService#failAllListenersOnMasterFailOver`, leading to the repository generation not getting correctly set in the cluster state down the line.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>bug :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v7.17.12 v8.7.0 v8.8.0

7 participants