Get-ZrStoreCount
Reports per-node item counts for a store and checks them against expectations. Run it to verify data is evenly distributed, to confirm the logical store size, or to check that replicas hold the same counts as their active partitions.
Syntax
Get-ZrStoreCount
-StoreName <string>
[-NodeId <string>]
[-TimeoutMs <int>]
[-Detailed]
[-CompareReplicas]
[-AsJson]
[-Managers <string[]>] [-Port <int>] [-Token <string>] [-TimeoutSec <int>]
Description
Get-ZrStoreCount collects store-count diagnostics from every node of the named store. By default it summarizes each node's total item count and compares its actual segment count against the segment count expected from the partition map, plus the logical store size. -Detailed switches to a per-segment breakdown per node, and -CompareReplicas cross-checks each partition's active-node count against its replica counts (it also reads the partition runtime to pair actives with replicas).
The output is a rendered console table; use -AsJson to emit the raw typed result as indented JSON. The cmdlet requires an active workspace (see New-ZrWorkspace / Use-ZrWorkspace) or an explicit -Managers list.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
-StoreName | string | Yes | Name of the store whose counts to collect. |
-NodeId | string | No | Restricts collection to a single node id; when omitted every node in the store is queried. |
-TimeoutMs | int | No | Per-node collection timeout in milliseconds; when omitted the server default is used. |
-Detailed | switch | No | Shows a per-segment count breakdown per node instead of the per-node summary. |
-CompareReplicas | switch | No | Compares each partition's active-node item count against its replica counts to check for divergence. |
-AsJson | switch | No | Emits the raw typed diagnostics result as indented JSON instead of the formatted table. |
-Managers | string[] | No | Management Service endpoints to target; when omitted the active workspace's managers are used. |
-Port | int | No | Management Service port for bare-host managers. Default 7801. |
-Token | string | No | Admin bearer token for authenticated control-plane calls. |
-TimeoutSec | int | No | Per-request timeout in seconds. Default 30. |
Examples
Show the per-node count summary for the orders store.
Get-ZrStoreCount -StoreName orders
Compare each partition's active-node count against its replicas to check for divergence.
Get-ZrStoreCount -StoreName orders -CompareReplicas
Reading the output
The default summary has one row per node:
TotalCount— the total items the node holds, including replica copies.ExpectedSegments— the segment count that node should own per the partition map;-when the map could not be read.ActualSegments— the segment count the node actually reports.Match—Yes(green) when expected equals actual,No(red) when they differ,-when there is no expectation to compare against.Total items in store(shown when more than one node) — the logical store size, summed from each node's active-owned count so each key is counted once (per-nodeTotalCountwould double-count replica copies).
With -Detailed, rows are segments and columns are nodes, ending in a per-node Total. With -CompareReplicas, each row pairs a partition's ActiveNode/ActiveCount with a ReplicaNode/ReplicaCount and a Match flag — a No here means a replica's item count has drifted from its active, which warrants investigation.