From 2f5b9fbbd83cf919f18749d632d046b1e7c75c2a Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Tue, 7 Mar 2023 14:05:27 +0100 Subject: [PATCH] Restore contribution of the index sizes to the db size - the index size now contributes to the db size even if the index is not authorized --- meilisearch/src/routes/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meilisearch/src/routes/mod.rs b/meilisearch/src/routes/mod.rs index f54c8ee38..c824d3f36 100644 --- a/meilisearch/src/routes/mod.rs +++ b/meilisearch/src/routes/mod.rs @@ -260,13 +260,17 @@ pub fn create_all_stats( let mut indexes = BTreeMap::new(); let mut database_size = 0; - // accumulate the size of each indexes for index_uid in index_scheduler.index_names()? { + // Accumulate the size of all indexes, even unauthorized ones, so + // as to return a database_size representative of the correct database size on disk. + // See for context. + let stats = index_scheduler.index_stats(&index_uid)?; + database_size += stats.inner_stats.database_size; + if !filters.is_index_authorized(&index_uid) { continue; } - let stats = index_scheduler.index_stats(&index_uid)?; last_task = last_task.map_or(Some(stats.inner_stats.updated_at), |last| { Some(last.max(stats.inner_stats.updated_at)) });