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

Remove Dead Code from Closed Index Snapshot Logic #56764

Conversation

original-brownbear
Copy link
Member

@original-brownbear original-brownbear commented May 14, 2020

The code path for closed indices is dead code here ever since #39644
because shards(currentState, indexIds, ...) does not set
MISSING on a closed index's shard that is assigned any longer. Before that change it would always set MISSING for a closed index's shard even it was assigned.
=> simplified the code accordingly.

The code path for closed indices is dead code here ever since elastic#39644
because `shards(currentState, indexIds, ...)` does not set
`MISSING` on a closed index's shard any longer.
=> simplified the code accordingly.
@original-brownbear original-brownbear added >non-issue :Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v8.0.0 v7.9.0 labels May 14, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore)

@elasticmachine elasticmachine added the Team:Distributed Meta label for distributed team label May 14, 2020
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.

since #39644
because shards(currentState, indexIds, ...) does not set
MISSING on a closed index's shard any longer.

Just to reword what you said: #39644 removed a specific condition on the index metadata state CLOSE that makes the shards() method to always set MISSING on a closed index's shard. So since #39644 this method sets MISSING for shards if they are unassigned or not started whatever the state OPEN/CLOSE of the index they belong to.

Your change make it clearer that we only care about missing shardsand make no distinction between missing closed and missing open shards.

LGTM

@original-brownbear
Copy link
Member Author

Thanks Tanguy! + Good point, I reworded the PR description :)

@original-brownbear original-brownbear merged commit 7e989ab into elastic:master May 14, 2020
@original-brownbear original-brownbear deleted the cleanup-closed-indices-code branch May 14, 2020 16:13
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Jul 13, 2020
The code path for closed indices is dead code here ever since elastic#39644
because `shards(currentState, indexIds, ...)` does not set
`MISSING` on a closed index's shard that is assigned any longer. Before that change it would always set `MISSING` for a closed index's shard even it was assigned.
=> simplified the code accordingly.
original-brownbear added a commit that referenced this pull request Jul 13, 2020
The code path for closed indices is dead code here ever since #39644
because `shards(currentState, indexIds, ...)` does not set
`MISSING` on a closed index's shard that is assigned any longer. Before that change it would always set `MISSING` for a closed index's shard even it was assigned.
=> simplified the code accordingly.
@original-brownbear original-brownbear restored the cleanup-closed-indices-code branch August 6, 2020 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >non-issue Team:Distributed Meta label for distributed team v7.9.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants