Skip to content
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

Merged
merged 1 commit into from
Oct 17, 2023

Conversation

SeanHai
Copy link
Contributor

@SeanHai SeanHai commented Aug 31, 2023

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:
截屏2023-08-31 16 25 50

after fix:
截屏2023-08-31 16 35 03

What's Changed:

How it Works:

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@SeanHai
Copy link
Contributor Author

SeanHai commented Aug 31, 2023

cicheck

@wuhongsong wuhongsong added the repairing bug repairing label Oct 10, 2023
Copy link
Contributor

@wu-hanqing wu-hanqing left a 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;
Copy link
Contributor

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.

Copy link
Contributor Author

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>
@SeanHai
Copy link
Contributor Author

SeanHai commented Oct 17, 2023

cicheck

@SeanHai
Copy link
Contributor Author

SeanHai commented Oct 17, 2023

Do you need to add unit tests?

add utests

@SeanHai SeanHai merged commit 5df3d6b into opencurve:master Oct 17, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
repairing bug repairing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants