Skip to content

Conversation

DaveCTurner
Copy link
Contributor

Today if you attempt to verify the integrity of a brand-new repository
(no index-${N} blob) then it will fail because the repository
generation is -1 which cannot be sent over the wire. But it makes no
sense to verify the integrity of such a repository anyway, so with this
commit we fail such requests up-front with a more helpful error message.

Today if you attempt to verify the integrity of a brand-new repository
(no `index-${N}` blob) then it will fail because the repository
generation is `-1` which cannot be sent over the wire. But it makes no
sense to verify the integrity of such a repository anyway, so with this
commit we fail such requests up-front with a more helpful error message.
@DaveCTurner DaveCTurner added >bug :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs auto-backport Automatically create backport pull requests when merged Supportability Improve our (devs, SREs, support eng, users) ability to troubleshoot/self-service product better. v9.2.0 v9.1.1 v8.19.1 v9.0.5 v8.18.5 labels Jul 22, 2025
@DaveCTurner DaveCTurner requested a review from ywangd July 22, 2025 07:56
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Coordination Meta label for Distributed Coordination team label Jul 22, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Hi @DaveCTurner, I've created a changelog YAML for you.

Copy link
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

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

LGTM


static void ensureValidGenId(long repositoryGenId) {
if (repositoryGenId == RepositoryData.EMPTY_REPO_GEN) {
throw new IllegalArgumentException("repository is empty, cannot verify its integrity");
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I think there is "no need" to verify its integrity instead of "cannot". The later is technically correct due to the negative number. But the former reads more friendly and helpful. It might even be OK to return empty response here. But an exception seems slightly more preferrable.

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 know what you mean, but my rationale for using "cannot" here is that the user has probably made a mistake with their repository config to get to this point (e.g. incorrect bucket or base path) - that seems much more likely than a user just wanting to check a totally empty bucket for integrity violations.

@DaveCTurner DaveCTurner merged commit 03ca86b into elastic:main Jul 22, 2025
33 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
9.1 Commit could not be cherrypicked due to conflicts
8.19 Commit could not be cherrypicked due to conflicts
9.0 Commit could not be cherrypicked due to conflicts
8.18 Commit could not be cherrypicked due to conflicts

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

DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jul 22, 2025
Today if you attempt to verify the integrity of a brand-new repository
(no `index-${N}` blob) then it will fail because the repository
generation is `-1` which cannot be sent over the wire. But it makes no
sense to verify the integrity of such a repository anyway, so with this
commit we fail such requests up-front with a more helpful error message.

Backport of elastic#131677 to `9.1`
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jul 22, 2025
Today if you attempt to verify the integrity of a brand-new repository
(no `index-${N}` blob) then it will fail because the repository
generation is `-1` which cannot be sent over the wire. But it makes no
sense to verify the integrity of such a repository anyway, so with this
commit we fail such requests up-front with a more helpful error message.

Backport of elastic#131677 to `9.0`
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jul 22, 2025
Today if you attempt to verify the integrity of a brand-new repository
(no `index-${N}` blob) then it will fail because the repository
generation is `-1` which cannot be sent over the wire. But it makes no
sense to verify the integrity of such a repository anyway, so with this
commit we fail such requests up-front with a more helpful error message.

Backport of elastic#131677 to `8.19`
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jul 22, 2025
Today if you attempt to verify the integrity of a brand-new repository
(no `index-${N}` blob) then it will fail because the repository
generation is `-1` which cannot be sent over the wire. But it makes no
sense to verify the integrity of such a repository anyway, so with this
commit we fail such requests up-front with a more helpful error message.

Backport of elastic#131677 to `8.18`
@DaveCTurner DaveCTurner deleted the 2025/07/22/repo-integrity-empty-repo branch July 22, 2025 11:56
elasticsearchmachine pushed a commit that referenced this pull request Jul 22, 2025
Today if you attempt to verify the integrity of a brand-new repository
(no `index-${N}` blob) then it will fail because the repository
generation is `-1` which cannot be sent over the wire. But it makes no
sense to verify the integrity of such a repository anyway, so with this
commit we fail such requests up-front with a more helpful error message.

Backport of #131677 to `9.0`
elasticsearchmachine pushed a commit that referenced this pull request Jul 22, 2025
Today if you attempt to verify the integrity of a brand-new repository
(no `index-${N}` blob) then it will fail because the repository
generation is `-1` which cannot be sent over the wire. But it makes no
sense to verify the integrity of such a repository anyway, so with this
commit we fail such requests up-front with a more helpful error message.

Backport of #131677 to `8.19`
elasticsearchmachine pushed a commit that referenced this pull request Jul 22, 2025
Today if you attempt to verify the integrity of a brand-new repository
(no `index-${N}` blob) then it will fail because the repository
generation is `-1` which cannot be sent over the wire. But it makes no
sense to verify the integrity of such a repository anyway, so with this
commit we fail such requests up-front with a more helpful error message.

Backport of #131677 to `8.18`
elasticsearchmachine pushed a commit that referenced this pull request Jul 22, 2025
Today if you attempt to verify the integrity of a brand-new repository
(no `index-${N}` blob) then it will fail because the repository
generation is `-1` which cannot be sent over the wire. But it makes no
sense to verify the integrity of such a repository anyway, so with this
commit we fail such requests up-front with a more helpful error message.

Backport of #131677 to `9.1`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged >bug :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs Supportability Improve our (devs, SREs, support eng, users) ability to troubleshoot/self-service product better. Team:Distributed Coordination Meta label for Distributed Coordination team v8.18.5 v8.19.1 v9.0.5 v9.1.1 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants