summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2024-06-18 13:21:45 +0300
committerGitHub <noreply@github.com>2024-06-18 13:21:45 +0300
commit22c3d3f58e56f8636895042db12d7a92876de114 (patch)
treeecbd2dc75fbfba34ec7f953f60a3561f92589dcf /src
parent8a095f41efd7db4696631deb41b825635c6f7c36 (diff)
Fix disk max calculation (#17945)
Diffstat (limited to 'src')
-rw-r--r--src/database/contexts/api_v2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/database/contexts/api_v2.c b/src/database/contexts/api_v2.c
index 03d5377090..07cd3ac838 100644
--- a/src/database/contexts/api_v2.c
+++ b/src/database/contexts/api_v2.c
@@ -1182,11 +1182,13 @@ void buffer_json_agents_v2(BUFFER *wb, struct query_timings *timings, time_t now
group_seconds *= storage_tiers_grouping_iterations[tier];
uint64_t max = storage_engine_disk_space_max(eng->seb, localhost->db[tier].si);
+ uint64_t used = storage_engine_disk_space_used(eng->seb, localhost->db[tier].si);
#ifdef ENABLE_DBENGINE
- if (!max && eng->seb == STORAGE_ENGINE_BACKEND_DBENGINE)
+ if (!max && eng->seb == STORAGE_ENGINE_BACKEND_DBENGINE) {
max = get_directory_free_bytes_space(multidb_ctx[tier]);
+ max += used;
+ }
#endif
- uint64_t used = storage_engine_disk_space_used(eng->seb, localhost->db[tier].si);
time_t first_time_s = storage_engine_global_first_time_s(eng->seb, localhost->db[tier].si);
size_t currently_collected_metrics = storage_engine_collected_metrics(eng->seb, localhost->db[tier].si);