refactor: adjust the related filters of sofa-bolt#2735
refactor: adjust the related filters of sofa-bolt#2735simon824 merged 8 commits intoapache:masterfrom
Conversation
| private RpcServer createRaftRpcServer(String raftAddr, List<PeerId> peers) { | ||
| Endpoint endpoint = JRaftUtils.getEndPoint(raftAddr); | ||
| RpcServer rpcServer = RaftRpcServerFactory.createRaftRpcServer(endpoint); | ||
| configureRaftServerIpWhitelist(peers, rpcServer); |
There was a problem hiding this comment.
How does the raft group member change? If the raft member changed, the whiteList ip should been sync changed
There was a problem hiding this comment.
1、The whitelist IPs are sourced from the peer-list configuration file. The current solution rejects all Raft-related requests from nodes not in the peer-list.
2、I understand that the members of the Raft group are a subset of the peer-list. Please correct me if there are any errors in this understanding.
thanks
There was a problem hiding this comment.
Pull Request Overview
This PR refactors and optimizes the filters used in the sofa-bolt components of the system. The key changes include:
- Introducing a new Hessian serializer factory for controlling class whitelist in serialization.
- Adding an IP authentication handler for validating incoming connections.
- Adjusting the Raft engine to integrate the new IP whitelist configuration and serializer.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/raft/serializer/HugegraphHessianSerializerFactory.java | Introduces the new serializer factory with whitelist management. |
| hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/raft/auth/IpAuthHandler.java | Adds IP authentication with logging for connection issues. |
| hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/raft/RaftEngine.java | Modifies Raft server initialization to configure IP white-listing. |
| hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/raft/KVOperation.java | Updates to use the new serializer factory for deserialization. |
hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/raft/auth/IpAuthHandler.java
Outdated
Show resolved
Hide resolved
hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/raft/auth/IpAuthHandler.java
Outdated
Show resolved
Hide resolved
hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/raft/auth/IpAuthHandler.java
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2735 +/- ##
=============================================
- Coverage 46.98% 35.08% -11.90%
+ Complexity 821 633 -188
=============================================
Files 745 747 +2
Lines 60060 60133 +73
Branches 7669 7673 +4
=============================================
- Hits 28218 21097 -7121
- Misses 29018 36724 +7706
+ Partials 2824 2312 -512 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…raft/auth/IpAuthHandler.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…raft/auth/IpAuthHandler.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR refactors and optimizes the filters used in the sofa-bolt components of the system. The key changes include:
PS: Future devs can add a configuration set to allow non-peer nodes communicating with Raft cluster when needed.