Skip to content

[Bug] GET / endpoint always returns memberSize:0 regardless of actual PD member count #3002

@bitflicker64

Description

@bitflicker64

Bug Type (问题类型)

other exception / error (其他异常报错)

Before submit

  • 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

Environment (环境信息)

  • Server Version: 1.7.0 (latest Docker image)
  • Backend: hstore 3 nodes
  • OS: macOS (Apple M4), Docker Desktop
  • Data Size: N/A — reproducible on fresh cluster

Expected & Actual behavior (期望与实际表现)

The memberSize field in the response from GET / (IndexAPI) always returns 0
regardless of how many PD nodes are actually in the cluster.

Actual:
curl -u store:store http://localhost:8620/
{"state":"Cluster_Not_Ready","leader":"pd2:8686","memberSize":0,"storeSize":3,...}

Expected:
memberSize should return 3 for a 3-node PD cluster.

Root cause:
IndexAPI.index() sets storeSize, graphSize, partitionSize, leader but never
sets memberSize on the BriefStatistics object. The field defaults to 0.

The /v1/cluster endpoint in the same file does it correctly:
statistics.memberSize = pdList.size();

Fix: add the equivalent line in index() using
RaftEngine.getInstance().getMembers().size()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is neededpdPD module

    Type

    No fields configured for Task.

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions