Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Bug] PD raft port accepts jraft CLI membership requests, which bypass the checks of changePeerList and updatePdRaft

Chiusa
#3,386 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #3387 di @Mihir-Rabari — integrata

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
java
Ambito
backend, databases

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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 master at 86c05ef9c (1.8.0-SNAPSHOT), jraft 1.3.14 (jraft.version in 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

Lingua principale
Java
Stelle
3.2k
Fork
640
Merge medio
1g 12h
PR unite (30g)
98

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/hugegraph

Tutte le issue di apache/hugegraph

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.