Skip to content

Commit

Permalink
cluster: Update cloud storage bytes on followers
Browse files Browse the repository at this point in the history
- Cloud storage metrics were only reported correctly when queried on the
leader node.

- This change ensures that the metric when queried is saved in memory in
the health_montior on followers

- Fixes: redpanda-data#9702
  • Loading branch information
graphcareful committed Apr 7, 2023
1 parent 60bd6df commit 5a37b5d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/v/cluster/health_monitor_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ cluster_health_report health_monitor_backend::build_cluster_report(
return cluster_health_report{
.raft0_leader = _raft0->get_leader_id(),
.node_states = std::move(statuses),
.node_reports = std::move(reports)};
.node_reports = std::move(reports),
.bytes_in_cloud_storage = _bytes_in_cloud_storage};
}

void health_monitor_backend::refresh_nodes_status() {
Expand Down Expand Up @@ -378,6 +379,7 @@ health_monitor_backend::dispatch_refresh_cluster_health_request(
_reports.emplace(id, std::move(n_report));
}

_bytes_in_cloud_storage = reply.value().report->bytes_in_cloud_storage;
_reports_disk_health = cluster_disk_health;
_last_refresh = ss::lowres_clock::now();
co_return make_error_code(errc::success);
Expand Down

0 comments on commit 5a37b5d

Please sign in to comment.