-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Remove Dead Code from Closed Index Snapshot Logic #56764
Conversation
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.
Pinging @elastic/es-distributed (:Distributed/Snapshot/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.
since #39644
becauseshards(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
Thanks Tanguy! + Good point, I reworded the PR description :) |
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.
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 #39644
because
shards(currentState, indexIds, ...)
does not setMISSING
on a closed index's shard that is assigned any longer. Before that change it would always setMISSING
for a closed index's shard even it was assigned.=> simplified the code accordingly.