Open wu-hanqing opened 1 year ago
I want to try it. Assign me plz.
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.
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.
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.