From ff000bb26cd462a68493c9f045bef8c0272e0805 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernardo=20De=20Marco=20Gon=C3=A7alves?= Date: Wed, 11 Nov 2026 10:04:59 -0300 Subject: [PATCH] Recalculate the allocated size in bytes for each Object Storage provider --- .../main/resources/META-INF/db/schema-42300to2400.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engine/schema/src/main/resources/META-INF/db/schema-42300to2400.sql b/engine/schema/src/main/resources/META-INF/db/schema-42300to2400.sql index 9aaf0905786f..68fdf1700c9b 100644 --- a/engine/schema/src/main/resources/META-INF/db/schema-42300to2400.sql +++ b/engine/schema/src/main/resources/META-INF/db/schema-42300to2400.sql @@ -241,3 +241,13 @@ CREATE TABLE IF NOT EXISTS `cloud`.`instance_boot_group_details` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.disk_offering', 'error_policy', 'VARCHAR(16) DEFAULT ''report'' COMMENT ''disk error policy (report/stop/ignore/enospace) used by KVM hypervisor'''); + +--- Recalculate the allocated size in bytes for each Object Storage provider +UPDATE `cloud`.`object_store` +JOIN ( + SELECT object_store_id, SUM(quota) * 1024 * 1024 * 1024 AS total_quota + FROM `cloud`.`bucket` + WHERE removed IS NULL + GROUP BY object_store_id +) buckets_quota_sum_view ON `object_store`.id = buckets_quota_sum_view.object_store_id +SET `object_store`.allocated_size = buckets_quota_sum_view.total_quota;