diff --git a/src/v/cluster/health_monitor_backend.cc b/src/v/cluster/health_monitor_backend.cc index ce0e89f215f9..86ed2e116074 100644 --- a/src/v/cluster/health_monitor_backend.cc +++ b/src/v/cluster/health_monitor_backend.cc @@ -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() { @@ -379,6 +380,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); diff --git a/src/v/kafka/server/usage_manager.cc b/src/v/kafka/server/usage_manager.cc index 494d4308b481..3b6eed3105fd 100644 --- a/src/v/kafka/server/usage_manager.cc +++ b/src/v/kafka/server/usage_manager.cc @@ -367,7 +367,7 @@ ss::future<> usage_manager::reset() { oncore_debug_verify(_verify_shard); try { auto h = _background_gate.hold(); - auto u = _background_mutex.get_units(); + auto u = co_await _background_mutex.get_units(); if (_accounting_fiber) { /// Deallocate the accounting_fiber if the feature is disabled, /// otherwise it will keep in memory the number of configured diff --git a/tests/rptest/tests/usage_test.py b/tests/rptest/tests/usage_test.py index c82a60725854..64a4b03431f9 100644 --- a/tests/rptest/tests/usage_test.py +++ b/tests/rptest/tests/usage_test.py @@ -281,15 +281,16 @@ def check_usage(): manifest_usage = self.admin.cloud_storage_usage() reported_usage = self.admin.get_usage( random.choice(self.redpanda.nodes)) - reported_usage = max( - [x['cloud_storage_bytes_gauge'] for x in reported_usage]) + reported_usages = [ + x['cloud_storage_bytes_gauge'] for x in reported_usage + ] self.logger.info( f"Expected {manifest_usage} bytes of cloud storage usage") self.logger.info( - f"Max reported usages via kafka/usage_manager: {reported_usage}" + f"Max reported usages via kafka/usage_manager: {max(reported_usages)}" ) - return reported_usage == manifest_usage + return manifest_usage in reported_usages wait_until( check_usage,