bitflicker64 commented on issue #3001:
URL: https://github.com/apache/hugegraph/issues/3001#issuecomment-4275373112

   Hi @mywgl — this is a known bug that has been fixed in #2961, merged into 
master last month.
   
   **What's happening:**
   
   After a cluster restart, Raft elects a new leader non-deterministically, 
whoever gets enough votes first wins. This is normal and expected behavior, not 
a bug. The actual bug was in the redirect mechanism. When a client sends a 
request to a follower PD node, that follower needs to forward it to the current 
leader. To do that it makes an internal RPC call to discover the leader's gRPC 
address. This RPC was failing and returning null, causing the NPE you see:
   
   ```
   RaftRpcClient failed to call rpc to 192.168.1.103:8610 .null
   WARN redirect to leader with error
   ```
   
   **To answer your questions directly:**
   
   1. The leader changing on restart is Raft working correctly — not the 
problem. The problem was follower PD nodes couldn't redirect requests to the 
new leader. The fix ensures the cluster works regardless of which node wins 
election.
   
   2. This was not a single point of failure by design — it was a bug. With the 
fix applied, any PD node can be leader and the cluster handles it gracefully.
   
   **To find your current leader:**
   
   ```bash
   grep "becomes leader" /path/to/hugegraph-pd/logs/hugegraph-pd-stdout.log
   ```
   
   Whichever node prints output is the current leader. You can also confirm via 
REST API:
   
   ```bash
   curl -u store:store http://<any-pd-host>:8620/v1/members
   ```
   
   Look at the `pdLeader` field in the response.
   
   **What to do:**
   
   If you're on Docker, pull the latest image which already includes the fix:
   ```bash
   docker pull hugegraph/hugegraph:latest
   ```
   
   If you're on bare metal CentOS, the fix is currently in master. I'd 
recommend checking with the maintainers (@imbajin) on when it will be available 
in a release.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to