Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 6 additions & 0 deletions docs/changelog/86580.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 86580
summary: Correctly calculate disk usage for frozen data tier telemetry
area: Stats
type: bug
issues:
- 86055
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ private static void aggregateDataTierShardStats(NodeStats nodeStats, Index index
final List<IndexShardStats> allShardStats = nodeStats.getIndices().getShardStats(index);
if (allShardStats != null) {
for (IndexShardStats shardStat : allShardStats) {
accumulator.totalByteCount += shardStat.getTotal().getStore().getSizeInBytes();
accumulator.totalByteCount += shardStat.getTotal().getStore().totalDataSetSizeInBytes();
accumulator.docCount += shardStat.getTotal().getDocs().getCount();

// Accumulate stats about started shards
Expand All @@ -215,7 +215,7 @@ private static void aggregateDataTierShardStats(NodeStats nodeStats, Index index
if (primaryStoreStats != null) {
// if primaryStoreStats is null, it means there is no primary on the node in question
accumulator.primaryShardCount++;
long primarySize = primaryStoreStats.getSizeInBytes();
long primarySize = primaryStoreStats.totalDataSetSizeInBytes();
accumulator.primaryByteCount += primarySize;
accumulator.valueSketch.add(primarySize);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ private List<NodeStats> buildNodeStats(ClusterState clusterState, long bytesPerS
}

private static ShardStats shardStat(long byteCount, long docCount, ShardRouting routing) {
StoreStats storeStats = new StoreStats(byteCount, 0L, 0L);
StoreStats storeStats = new StoreStats(randomNonNegativeLong(), byteCount, 0L);
DocsStats docsStats = new DocsStats(docCount, 0L, byteCount);

CommonStats commonStats = new CommonStats(CommonStatsFlags.ALL);
Expand Down