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.
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-17496. DataNode supports more fine-grained dataset lock based on blockid. #6764
base: trunk
Are you sure you want to change the base?
HDFS-17496. DataNode supports more fine-grained dataset lock based on blockid. #6764
Changes from 9 commits
fcf8021
db36a2b
dc09713
89ca2cd
c723265
3d579ae
94d6660
4751846
263a5ca
d4f9eb1
9eb153c
226cd5b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What's different between
idToBlockDir
andidToBlockDirSuffixName
?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.
idToBlockDirSuffixName method is used to generate SubDir lock name, just like BlockPool id or storageuuid.
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.
I didn't get what this method want to do, and why there are double layer loop (include the invoke enter) and user 0x1F as end condition.
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.
This method is used to generate all subdir lock name. We use 0x1F as end condition because the layout of DataNode.
Each blockpool dir under one volume has two layer subdir, like subdir1/subdir31.
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.
When DataNode starts, we will initial all dataset subdir lock in advance. Every volume has its subdir dataset locks.
In current layout of datanode's storage directory, we have 32 multipy 32 subdirs in each volume.
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.
I don't think this is good idea to follow the current directory layout to construct lock based blockid. since:
a. We have to keep same logic between the directory layout and block/subdir lock, right? However it implements at different place without any constraint, which will involve some cost for the future improvement when change the directory layout.
b. I think we could decouple block/subdir lock from directory layout, define another rule for block/subdir lock with blockid only(such as
id mod 1000
, split one volume lock to 1000 locks is enough to improve the performance), which I think it make sense to block/subdir.What do you think about? Thanks.