Skip to content

Conversation

@original-brownbear
Copy link
Contributor

@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.
@elasticmachine
Copy link
Collaborator

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

@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. 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
Contributor 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 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.9.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants