-
Notifications
You must be signed in to change notification settings - Fork 500
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
improve partition range management #2727
Conversation
cicheck |
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.
Do you need to add unit tests?
@@ -55,6 +55,8 @@ struct ClusterInformation { | |||
std::string clusterId; | |||
// <fsId, partition index of this fs> | |||
std::map<uint32_t, uint32_t> partitionIndexs; | |||
// <fsId, next inode id> | |||
std::unordered_map<uint32_t, uint64_t> fsMaxAllocatedInodeId; |
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.
How about fsNextInodeId
? And there are also some related functions that can be modified according to this.
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.
fixed
Signed-off-by: wanghai01 <seanhaizi@163.com>
e239589
to
47debfa
Compare
cicheck |
add utests |
What problem does this PR solve?
The previous logic of allocate inode range to partition is: index of partiton in this fs * range form conf.
For example, there are five partitions in fs and each manage 100 inodes:
p1 0-99
p2 100-199
p3 200-299
p4 300-399
p5 400-499
If you make this conf value smaller(maybe 80) and upgrade mds:
p1 0-99
p2 100-199
p3 200-299
p4 300-399
p5 400-499
p6: 400-479 new allocated partition will have repetitive parts with previous partition.
Issue Number: #xxx
Problem Summary:
What is changed and how it works?
Now we will change allocation algorithm and record max inodeId of fs.
previous:
after fix:
What's Changed:
How it Works:
Side effects(Breaking backward compatibility? Performance regression?):
Check List