[Bug] PD raft port accepts jraft CLI membership requests, which bypass the checks of changePeerList and updatePdRaft
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #3387 của @Mihir-Rabari — đã merge
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start with RaftEngine.createRaftRpcServer and inspect how RaftRpcServerFactory.createRaftRpcServer(endpoint) registers CLI processors alongside replication processors. Trace changePeerList and PDService.updatePdRaft to identify the checks these requests must share. The issue describes either removing CLI membership processors while retaining replication processors, and optionally GetLeader and GetPeers, or wrapping them with the same checks; done means CLI requests cannot bypass those checks. Pull request #3387 is already open.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug Type (问题类型)
logic (逻辑设计问题)
Before submit
- I have confirmed and searched that there are no similar problems in the historical issue and documents
Environment (环境信息)
- Server Version: PD on
masterat86c05ef9c(1.8.0-SNAPSHOT), jraft 1.3.14 (jraft.versionin the root pom) - Backend: PD raft group (3 or more PD nodes)
- OS: any
- Data Size: N/A
Expected & Actual behavior (期望与实际表现)
PD changes its raft membership through two of its own entry points, RaftEngine.changePeerList (the changePeerList RPC and REST call) and PDService.updatePdRaft. Its raft RPC server also accepts jraft's own CLI membership requests, which bypass both.
RaftEngine.createRaftRpcServer builds the server with RaftRpcServerFactory.createRaftRpcServer(endpoint), which registers jraft's CLI processors next to the replication ones. Checked with javap on the jraft 1.3.14 jar, RaftRpcServerFactory adds, among others:
cli/AddPeerRequestProcessor
cli/RemovePeerRequestProcessor
cli/ChangePeersRequestProcessor
cli/ResetPeerRequestProcessor
cli/AddLearnersRequestProcessor
cli/RemoveLearnersRequestProcessor
cli/ResetLearnersRequestProcessor
cli/TransferLeaderRequestProcessor
cli/SnapshotRequestProcessor
So a jraft CliService client that reaches a PD raft port can add, remove or reset peers and learners, or transfer the leadership, with none of the checks PD runs on its own paths. Today that skips, for example, the odd peer count check of changePeerList and the IpAuthHandler refresh after a change. The raft IP allowlist (raft.ip-whitelist.enabled, on by default) limits such a client to the IPs of the current peers, so it has to run on a PD host or share its IP.
It matters more once PD checks peers before a membership change. #3376 adds a txn raft entry, and both of PD's own membership paths refuse to add a peer that does not apply that entry, since an older PD would skip it when it replays the log. A peer added through the CLI processors is not checked.
Expected: membership changes go through one path that runs PD's checks. Either the CLI membership processors are not registered on PD's raft server (keeping the replication processors and, if wanted, GetLeader and GetPeers), or they are wrapped so they run the same checks as changePeerList.
Vertex/Edge example (问题点 / 边数据举例)
N/A
Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
N/A
- Ngôn ngữ chính
- Java
- Star
- 3.2k
- Fork
- 640
- Merge trung bình
- 1 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 98
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/hugegraph
-
[Bug] PD task REST: balanceLeaders throws a bare HTTP 500 during the balance-shard window, and task responses cannot be told apart from a no-op or a follower answerCó thể đã có người làm @pallavithegod đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
apache/hugegraph#3231 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] PD TTL cleanup deletes the marker-shaped name instead of the expired key, so expired values stay in the store until readCó thể đã có người làm @bitflicker64 đã nhận 2 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Task] Establish systematic performance baselines and optimization trackingCó thể đã có người làm @contrueCT đã nhận 6 ngày trước. Đang mởhelp wanted improvement rust
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
apache/hugegraph#3346 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/hugegraph
Issue tương tự
-
[GLOBAL] Advancement resetĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Vakore/ZappierGames#184 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
lugassawan/swe-workbench#823 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
cassiancc/Raspberry-Core#69 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
IronCoreLabs/ironcore-alloy#351 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
checkstyle/checkstyle#22145 ·
Maintainer thường phản hồi trong vòng 1 ngày