HDFS-17798. Fixed the issue where bad replicas in the mini cluster could not be automatically replicated #7749
+81
−1
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.
Description of PR
In a 3-datanode cluster with a 3-replica block, if one replica on a node becomes corrupted (and this corruption did not occur during the write process), it will result in:
The corrupted replica cannot be removed from the damaged node.
Due to the missing replica, replication reconstruction tasks will continuously attempt to replicate the corrupted replica.
However, during reconstruction, nodes already hosting a replica of this block are excluded—meaning all 3 datanodes are excluded.
This prevents the selection of a suitable target node for replication, eventually creating a vicious cycle.
reproduction
Or execute in the 3datanode cluster in the following order
Find a normal block with three replicas and destroy the replica file of one of its Datanodes
When waiting for the datanode disk scan cycle, it will be found that there is a damaged copy and it cannot be rebuilt by other copies
In the TestBlockManager add testMiniClusterCannotReconstructionWhileReplicaAnomaly
How was this patch tested?
Unit test
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?