-
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-17150. EC: Fix the bug of failed lease recovery. #5937
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3816,8 +3816,13 @@ boolean internalReleaseLease(Lease lease, String src, INodesInPath iip, | |
pendingFile.removeLastBlock(lastBlock); | ||
finalizeINodeFileUnderConstruction(src, pendingFile, | ||
iip.getLatestSnapshotId(), false); | ||
NameNode.stateChangeLog.warn("BLOCK* internalReleaseLease: " | ||
+ "Removed empty last block and closed file " + src); | ||
if (uc.getNumExpectedLocations() == 0) { | ||
NameNode.stateChangeLog.warn("BLOCK* internalReleaseLease: " | ||
+ "Removed empty last block and closed file " + src); | ||
} else { | ||
NameNode.stateChangeLog.warn("BLOCK* internalReleaseLease: " | ||
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. A little weird that if we can determine it is EC file here when 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.
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. Totally true, but poor readability. Any other way to improve it, such as 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.
How about adding some comments here? |
||
+ "Removed last unrecoverable block group and closed file " + src); | ||
} | ||
return true; | ||
} | ||
// Start recovery of the last block for this file | ||
|
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.
Here how about update to this judgment logic?
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.
If
uc.getNumExpectedLocations()
is 0, regardless of whether it is a striped block or not, I think we should all consider it to be an empty block, not unrecoverable. So I think the code before is better. What's your opinion?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.
yeah, I understand your thoughts,
Perhaps it would be better to add some comment description.