Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public BriefStatistics index() throws PDException, ExecutionException, Interrupt
BriefStatistics statistics = new BriefStatistics();
statistics.leader = RaftEngine.getInstance().getLeaderGrpcAddress();
statistics.state = pdService.getStoreNodeService().getClusterStats().getState().toString();
statistics.memberSize = RaftEngine.getInstance().getMembers().size();
statistics.storeSize = pdService.getStoreNodeService().getActiveStores().size();
statistics.graphSize = pdService.getPartitionService().getGraphs().size();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous fix adds:
statistics.memberSize = RaftEngine.getInstance().getMembers().size();

But the cluster() method (the "correct" counterpart) uses the service layer:

pdService.getMembers(Pdpb.GetMembersRequest.newBuilder().build(), response);
statistics.memberSize = pdList.size();  // from pdService, not RaftEngine

The issue discussion (comments 3–4 from bitflicker64 and dosubot) explicitly recommends using pdService.getMembers().size() for consistency with cluster() and to stay in the service layer. The merged fix goes against this recommendation.

statistics.partitionSize = pdService.getStoreNodeService().getShardGroups().size();
Expand Down
Loading