-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
HDFS-16479. EC: NameNode should not send a reconstruction work when the source datanodes are insufficient #4138
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8a4daad
HDFS-16479. EC: NameNode should not send a reconstruction work when t…
tasanuma 1b40cf5
addressing short data blocks
tasanuma 7784d02
use BlockInfoStriped.getRealDataBlockNum()
tasanuma f6c9d6b
add NameNode.getNameNodeMetrics().incNumTimesReReplicationNotScheduled()
tasanuma 494a921
fix typo comment
tasanuma a0d5756
update comments and variable names
tasanuma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2163,6 +2163,15 @@ BlockReconstructionWork scheduleReconstruction(BlockInfo block, | |
return null; | ||
} | ||
|
||
// skip if source datanodes for reconstructing ec block are not enough | ||
if (block.isStriped()) { | ||
BlockInfoStriped stripedBlock = (BlockInfoStriped) block; | ||
if (stripedBlock.getDataBlockNum() > srcNodes.length) { | ||
LOG.debug("Block {} cannot be reconstructed due to shortage of source datanodes ", block); | ||
return null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we increment the metrics before returning
|
||
} | ||
} | ||
|
||
// liveReplicaNodes can include READ_ONLY_SHARED replicas which are | ||
// not included in the numReplicas.liveReplicas() count | ||
assert liveReplicaNodes.size() >= numReplicas.liveReplicas(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Had a very quick look.
Just thinking about a scenario with say RS-6-3-1024k, and we just write 1 mb, in that case the total number of blocks available will be 1 Datablock + 3 Parity. In that case BG itself will have total 4 Blocks. Will this code start returning null? Not sure if
getRealDataBlockNum
helps here or not. If it is actually a problemThere 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.
@ayushtkn Thanks for your review. You're right, it's a problem.
I updated the PR to calculate the real data block number. It is the same logic used in StripedReader. I also added one more unit test to cover the case.