curve icon indicating copy to clipboard operation
curve copied to clipboard

[curvefs] metaserver background task optimization

Open wu-hanqing opened this issue 1 year ago • 5 comments

Situation

CurveFS metaserver is the metadata node of the fs cluster, which stores the dentry and inode information of the file system. Use the raft algorithm to ensure consistency among three replicas and provide high service availability.

In addition to managing metadata, metaserver is also responsible for functions such as s3compact and cleaning inodes. These functions need to operate metadata, so they need to generate a request to change metadata, and then call raft for processing.

At present, these functions will be executed simultaneously on three copies of metadata. When calling the raft process, it will determine whether the current copy is a raft leader. If not, the current task will be discarded.

Due to the fact that there is only one raft leader at the same time, the operations on the other two replicas are undoubtedly redundant, wasting a large amount of CPU resources when there are many background tasks.

Expectation

The background task only starts executing after the replica is selected as the leader and is automatically canceled after the leader abdicates.

wu-hanqing avatar Jun 25 '23 09:06 wu-hanqing

I want to try it. Assign me plz.

Ziy1-Tan avatar Sep 10 '23 06:09 Ziy1-Tan

I want to try it. Assign me plz.

You can submit a rough change plan first, and then proceed to actual code development after confirmation.

wu-hanqing avatar Sep 12 '23 02:09 wu-hanqing

I am a software engineer at a tech company, working on the company's product business logic. I am interested in C++ and distributed systems.

I chose this topic because I previously worked on several issues for CurveFS, and I want to learn more about Curve design and implementation details.

ken90242 avatar Nov 03 '23 08:11 ken90242

Hello, may I apply to solve this issue if this bro @ken90242 has not finished this issue over deadline or gived up. I have solved issue #2564 and associated pr #2976 is under review. I wanna contribute more to curve

wsehjk avatar Dec 27 '23 05:12 wsehjk

Hello, may I apply for to solve this issue if this bro @ken90242 has not finished this issue over deadline or gived up. I have solved issue #2564 and associated pr #2976 is under review. I wanna contribute more to curve

welcome:)

Ziy1-Tan avatar Dec 27 '23 05:12 Ziy1-Tan