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

feature: support node metadata sync #6326

Merged
merged 22 commits into from
Mar 5, 2024
Merged

feature: support node metadata sync #6326

merged 22 commits into from
Mar 5, 2024

Conversation

funky-eyes
Copy link
Contributor

@funky-eyes funky-eyes commented Feb 4, 2024

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

增加集群间元数据同步能力
1.leader选举成功后,生成只包含它自身的元数据,该元数据为一个单例,并同步至follower
2.follower收到这个元数据后,发送自身的元数据至server侧,进行补充follower的元数据
3.leader收到后,在元数据的follower中增加该节点,并推送元数据变更至client和其它tc节点
并且元数据中增加version字段,用于后续比如存在新旧多版本server,leader可以在同步的时候使用所有节点都能支持的协议,以便向下兼容。

Increase the ability of inter-cluster metadata synchronization

  1. After the leader election is successful, generate metadata containing only itself, which is a singleton and synchronized to followers
  2. After the follower receives this metadata, it sends its own metadata to the server side to supplement the follower's metadata.
  3. After the leader receives it, add the node to the follower of the metadata, and push the metadata changes to the client and other tc nodes
    And the version field is added to the metadata for subsequent use. For example, if there are old and new multi-version servers, the leader can use a protocol that all nodes can support during synchronization for backward compatibility.

Ⅱ. Does this pull request fix one issue?

image
image

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-commenter
Copy link

codecov-commenter commented Feb 23, 2024

Codecov Report

Attention: Patch coverage is 23.88060% with 102 lines in your changes are missing coverage. Please review.

Project coverage is 50.86%. Comparing base (13a5ada) to head (6a14625).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #6326      +/-   ##
============================================
- Coverage     50.95%   50.86%   -0.09%     
- Complexity     5278     5282       +4     
============================================
  Files           937      941       +4     
  Lines         33129    33232     +103     
  Branches       4016     4029      +13     
============================================
+ Hits          16881    16904      +23     
- Misses        14579    14656      +77     
- Partials       1669     1672       +3     
Files Coverage Δ
...g/apache/seata/server/cluster/raft/RaftServer.java 81.57% <100.00%> (+0.49%) ⬆️
...cluster/raft/sync/msg/dto/RaftClusterMetadata.java 89.28% <100.00%> (-10.72%) ⬇️
...e/seata/server/cluster/raft/RaftServerManager.java 86.13% <60.00%> (+0.42%) ⬆️
...in/java/org/apache/seata/common/metadata/Node.java 84.21% <0.00%> (-15.79%) ⬇️
...cluster/raft/serializer/JacksonBoltSerializer.java 40.00% <40.00%> (ø)
...raft/processor/request/PutNodeMetadataRequest.java 0.00% <0.00%> (ø)
...ft/processor/response/PutNodeMetadataResponse.java 0.00% <0.00%> (ø)
...er/raft/processor/PutNodeInfoRequestProcessor.java 27.27% <27.27%> (ø)
...he/seata/server/cluster/raft/RaftStateMachine.java 42.92% <20.48%> (-18.19%) ⬇️

... and 4 files with indirect coverage changes

@funky-eyes funky-eyes added module/server server module type: feature Category issues or prs related to feature request. labels Mar 1, 2024
@funky-eyes funky-eyes added this to the 2.1.0 milestone Mar 2, 2024
Copy link
Member

@ptyin ptyin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ptyin ptyin merged commit 80eb68c into apache:2.x Mar 5, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/server server module type: feature Category issues or prs related to feature request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants