HDDS-8535. ReplicationManager: Unhealthy containers could block EC recovery in small clusters #4756
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
With EC containers, if there is a small cluster of say 6 nodes with EC-3-2, a container will require 5 nodes. If 2 containers become unhealthy, reconstruction will be required to recover the 2 containers, but there is only 1 spare node.
This means one will get recovered, and we will have 4 "good" containers and 2
UNHEALTHY
and the container will remain stuck like this becauseUNHEALTHY
containers are only removed once the container has no over or under replication.A similar problem was resolved previously where an EC container with both over and under replication can meet the same problem, where under replication cannot proceed due to insufficient spare nodes. In that case, the solution was to check for this case, and call the over-replication handler to clear up the excess replicas.
This PR is still in draft state for some early reviews while I write tests and think about edge cases. Here, we try to delete an
UNHEALTHY
replica in the same handler to free up a DN. Then we throw the exception so that this container gets queued again in the under replication queue. Perhaps it's better to throw first if over replication handling is invoked, so we don't delete multiple replicas in one go.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8535
How was this patch tested?
Wrote one UT.