Skip to content

Check shard availability before including in stats #96015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions docs/changelog/96015.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pr: 96015
summary: Check shard availability before including in stats
area: Distributed
type: bug
issues:
- 96000
- 87001
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ private static void aggregateDataTierShardStats(NodeStats nodeStats, Index index
accumulator.docCount += shardStat.getTotal().getDocs().getCount();

// Accumulate stats about started shards
if (node.getByShardId(shardStat.getShardId()).state() == ShardRoutingState.STARTED) {
ShardRouting shardRouting = node.getByShardId(shardStat.getShardId());
if (shardRouting != null && shardRouting.state() == ShardRoutingState.STARTED) {
accumulator.totalShardCount += 1;

// Accumulate stats about started primary shards
Expand Down