dosubot[bot] commented on issue #3001: URL: https://github.com/apache/hugegraph/issues/3001#issuecomment-4275168544
<!-- Greeting --> Hi @mywgl! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the hugegraph team. <!-- Answer --> This looks like a known bug tracked in [#2959](https://github.com/apache/hugegraph/issues/2959) [[1]](https://github.com/apache/hugegraph/issues/2959). The root cause is a `NullPointerException` in `RaftEngine.getLeaderGrpcAddress()` — when a PD node is a follower, it tries to forward requests to the leader via a bolt RPC call, but the `CompletableFuture.get()` returns `null`, causing the NPE. The key issue is that after a cluster restart, if the Raft leader election picks a **different** PD node than the one that was leader before, follower PD nodes fail to redirect requests to the new leader. This causes store registration and partition distribution to break, making the cluster non-functional. **Your two questions:** 1. **Workaround**: As noted in #2959, restarting the non-leader PD nodes to force the original node to win the election can resolve the issue temporarily. However, this is not a proper fix — the underlying `getLeaderGrpcAddress()` NPE needs to be addressed in the codebase [[1]](https://github.com/apache/hugegraph/issues/2959). 2. **Why leader change breaks the cluster**: You're right that this effectively creates a single-point-of-failure issue. The cluster *should* handle leader changes gracefully — this is a bug, not by design. The `redirectToLeader()` mechanism is supposed to forward requests from follower PD nodes to the current leader, but the NPE prevents that from working correctly [[1]](https://github.com/apache/hugegraph/issues/2959). You may want to check if there is a fix available in a newer version or a related PR (e.g., [#2952](https://github.com/apache/hugegraph/pull/2952) was mentioned as related). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fhugegraph).* --- Share context across your team and agents. Try [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-tagline&utm_term=apache%2Fhugegraph). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-feedback&utm_term=apache%2Fhugegraph#message_id=59c94d55-f259-4e69-bb5c-3fbd0bf4f8da) [](https://github.dosu.com/apache/hugegraph?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-learn-repo&utm_term=apache%2Fhugegraph) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=knowledge-infrastructure-add-team&utm_term=apache%2Fhugegraph) -- 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]
