bitflicker64 commented on code in PR #3232:
URL: https://github.com/apache/hugegraph/pull/3232#discussion_r4090999317
##########
hugegraph-store/hg-store-node/src/main/java/org/apache/hugegraph/store/node/controller/PartitionAPI.java:
##########
@@ -87,8 +87,9 @@ public Map<String, Object> getPartitions(
raft.setGroupId(engine.getGroupId());
raft.setLeader(engine.getLeader());
raft.setRole(engine.getRaftNode().getNodeState().name());
- raft.setConf(engine.getCurrentConf().toString());
+ // jraft only lists peers and learners on the leader
if (engine.isLeader()) {
+ raft.setConf(engine.getCurrentConf().toString());
Review Comment:
Fixed in 8dd3665. The three leader-only calls now run in one `try` block and
are set only if all succeed; on `IllegalStateException` the group is logged and
left like a follower (`conf`, `peers`, `learners` null). Added
`testGetPartitionsWhenLeaderStepsDown`, where `isLeader()` returns true and the
node methods throw: it fails on fc017f8 with `Not leader` and passes now.
hg-store-node tests: 9 run, 0 failures.
--
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]